@airalogy/aimd-recorder 1.16.0 → 1.18.0
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/README.md +11 -10
- package/README.zh-CN.md +11 -10
- package/dist/AimdCodeField-BQUuM-EF.js +182 -0
- package/dist/{AimdDnaSequenceField-CPyMqIVh.js → AimdDnaSequenceField-KZU2Zj3E.js} +2 -2
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-lyHIpch9.js → AimdEditor.vue_vue_type_style_index_0_lang-CzfYPp5r.js} +3924 -3831
- package/dist/AimdMarkdownField-t2d8uOeU.js +254 -0
- package/dist/AimdMarkdownNoteField-_h1oZSwH.js +259 -0
- package/dist/{_commonjsHelpers-CZXJ37nu.js → _commonjsHelpers-B5RozER-.js} +2 -2
- package/dist/aimd-recorder.css +1 -1
- package/dist/arc-DS_ocYoe.js +83 -0
- package/dist/architectureDiagram-3BPJPVTR-Dq2W8_tb.js +4692 -0
- package/dist/blockDiagram-GPEHLZMM-B4hnSAF_.js +2425 -0
- package/dist/c4Diagram-AAUBKEIU-CbffqNLY.js +1577 -0
- package/dist/channel-CtXnYrAk.js +5 -0
- package/dist/chunk-2J33WTMH-CROScrt5.js +19 -0
- package/dist/chunk-4BX2VUAB-DTmsQu5_.js +8 -0
- package/dist/chunk-55IACEB6-B5wDJzeX.js +8 -0
- package/dist/chunk-727SXJPM-CfyltY6o.js +1528 -0
- package/dist/chunk-AQP2D5EJ-B8274EYy.js +1387 -0
- package/dist/chunk-FMBD7UC4-CT_FK-SH.js +19 -0
- package/dist/chunk-ND2GUHAM-g9GulPi-.js +68 -0
- package/dist/chunk-QZHKN3VN-Di5HEktz.js +15 -0
- package/dist/classDiagram-4FO5ZUOK-BVUr246k.js +16 -0
- package/dist/classDiagram-v2-Q7XG4LA2-BVUr246k.js +16 -0
- package/dist/components.js +3365 -2216
- package/dist/composables.js +92 -68
- package/dist/cose-bilkent-S5V4N54A-GJ4IOO6v.js +2609 -0
- package/dist/cytoscape.esm-r59gEWFs.js +18710 -0
- package/dist/dagre-BM42HDAG-oL7Br44o.js +445 -0
- package/dist/defaultLocale-BgPVtth8.js +171 -0
- package/dist/diagram-2AECGRRQ-DtoCG_N4.js +217 -0
- package/dist/diagram-5GNKFQAL-f8QNdS7L.js +123 -0
- package/dist/diagram-KO2AKTUF-CsJOW_AX.js +461 -0
- package/dist/diagram-LMA3HP47-xmEKNZ7y.js +142 -0
- package/dist/diagram-OG6HWLK6-unpC7vo8.js +528 -0
- package/dist/erDiagram-TEJ5UH35-BGzFnCJD.js +899 -0
- package/dist/flowDiagram-I6XJVG4X-LBFhDnOs.js +1628 -0
- package/dist/ganttDiagram-6RSMTGT7-CFBc-jPD.js +2707 -0
- package/dist/gitGraphDiagram-PVQCEYII-BLduh-Rb.js +815 -0
- package/dist/graph-DdlKE625.js +1510 -0
- package/dist/index.js +104 -80
- package/dist/infoDiagram-5YYISTIA-CLQQI6zM.js +24 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/ishikawaDiagram-YF4QCWOH-CStdYBmW.js +621 -0
- package/dist/journeyDiagram-JHISSGLW-B6mRTzoE.js +834 -0
- package/dist/kanban-definition-UN3LZRKU-C-vnN5v4.js +724 -0
- package/dist/katex-DNob3HGn.js +11690 -0
- package/dist/layout-DDt0fz-M.js +1703 -0
- package/dist/linear-C-IAFdOt.js +259 -0
- package/dist/mermaid.core-CuZ3nINf.js +15940 -0
- package/dist/mindmap-definition-RKZ34NQL-TSZ1Vb3z.js +827 -0
- package/dist/ordinal-B6-f3MAq.js +61 -0
- package/dist/pieDiagram-4H26LBE5-DYok-1-k.js +163 -0
- package/dist/quadrantDiagram-W4KKPZXB-Cg856sbH.js +1024 -0
- package/dist/requirementDiagram-4Y6WPE33-BN9fGdlJ.js +882 -0
- package/dist/sankeyDiagram-5OEKKPKP-CDqTgonY.js +847 -0
- package/dist/sequenceDiagram-3UESZ5HK-Chjrc0-W.js +2891 -0
- package/dist/stateDiagram-AJRCARHV-DRyLHrdr.js +263 -0
- package/dist/stateDiagram-v2-BHNVJYJU-CZTIDHid.js +16 -0
- package/dist/timeline-definition-PNZ67QCA-Bc3D9AAG.js +1055 -0
- package/dist/{useFieldRendering-Dh6Kib_0.js → useCodeBlockRendering-qA6gj4vz.js} +3041 -2255
- package/dist/useMonacoAutoHeight-D4T-El3J.js +66 -0
- package/dist/vennDiagram-CIIHVFJN-CYAul48m.js +1557 -0
- package/dist/wardley-L42UT6IY-D7b2ujEZ.js +22512 -0
- package/dist/wardleyDiagram-YWT4CUSO-B7Tg0MG9.js +675 -0
- package/dist/xychartDiagram-2RQKCTM6-xWYVEqth.js +1342 -0
- package/package.json +8 -7
- package/src/__tests__/assigner-runner-dependent-data.test.ts +32 -0
- package/src/__tests__/markdown-field.test.ts +150 -1
- package/src/__tests__/markdown-note-field.test.ts +86 -3
- package/src/__tests__/quiz-recorder.test.ts +47 -0
- package/src/__tests__/recorder-assigner-control.test.ts +844 -0
- package/src/__tests__/recorder-check-field.test.ts +103 -0
- package/src/__tests__/recorder-editor.test.ts +17 -0
- package/src/__tests__/recorder-markdown-assigner-integration.test.ts +49 -0
- package/src/__tests__/step-field.test.ts +87 -4
- package/src/__tests__/type-plugins.test.ts +1 -0
- package/src/__tests__/var-field-render.test.ts +741 -1
- package/src/components/AimdCodeField.vue +24 -5
- package/src/components/AimdMarkdownField.vue +548 -11
- package/src/components/AimdMarkdownNoteField.vue +241 -30
- package/src/components/AimdQuizOptionFollowups.vue +121 -0
- package/src/components/AimdQuizRecorder.vue +79 -148
- package/src/components/AimdRecorder.vue +1620 -98
- package/src/components/AimdRecorderEditor.vue +276 -8
- package/src/components/AimdRecorderWysiwygFieldHost.vue +6 -0
- package/src/components/AimdRecorderWysiwygSurface.vue +32 -0
- package/src/components/AimdStepCheckField.vue +205 -51
- package/src/components/AimdVarField.vue +694 -25
- package/src/components/AimdVarTableField.vue +283 -110
- package/src/components/icons/AimdAssignerCalculatorIcon.vue +18 -0
- package/src/components/icons/AimdAssignerCloudStatusIcon.vue +22 -0
- package/src/components/recorderMilkdownPlugin.ts +14 -0
- package/src/composables/__tests__/useRecordState.test.ts +114 -0
- package/src/composables/__tests__/useVarHelpers.test.ts +133 -0
- package/src/composables/index.ts +27 -1
- package/src/composables/useAssignerRunner.ts +376 -0
- package/src/composables/useCodeBlockRendering.ts +51 -0
- package/src/composables/useFieldRendering.ts +32 -4
- package/src/composables/useMonacoAutoHeight.ts +127 -0
- package/src/composables/useRecordState.ts +40 -14
- package/src/composables/useVarHelpers.ts +377 -9
- package/src/index.ts +13 -0
- package/src/locales.ts +47 -2
- package/src/styles/aimd.css +171 -6
- package/src/type-plugins.ts +7 -0
- package/src/types.ts +93 -2
- package/dist/AimdCodeField-DC3DPvgc.js +0 -172
- package/dist/AimdMarkdownField-CX71bOdX.js +0 -67
- package/dist/AimdMarkdownNoteField--ssNIQfG.js +0 -186
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { computed, defineAsyncComponent, defineComponent, h, onBeforeUnmount, ref, watch, type PropType, type VNodeChild } from "vue"
|
|
2
|
+
import { computed, defineAsyncComponent, defineComponent, h, nextTick, onBeforeUnmount, ref, watch, type PropType, type VNodeChild } from "vue"
|
|
3
3
|
import type { AimdStepNode, AimdCheckNode, AimdStepTimerMode } from "@airalogy/aimd-core/types"
|
|
4
4
|
import type { AimdRecorderMessages } from "../locales"
|
|
5
5
|
import { getAimdRecorderScopeLabel } from "../locales"
|
|
@@ -32,6 +32,7 @@ export const AimdStepField = defineComponent({
|
|
|
32
32
|
setup(props, { emit }) {
|
|
33
33
|
const nowMs = ref(Date.now())
|
|
34
34
|
const rootEl = ref<HTMLElement | null>(null)
|
|
35
|
+
const annotationDetailsEl = ref<HTMLElement | null>(null)
|
|
35
36
|
const annotationExpanded = ref(false)
|
|
36
37
|
const timerExpanded = ref(false)
|
|
37
38
|
let liveTimer: ReturnType<typeof setInterval> | null = null
|
|
@@ -122,7 +123,6 @@ export const AimdStepField = defineComponent({
|
|
|
122
123
|
|| timerExpanded.value
|
|
123
124
|
))
|
|
124
125
|
const showTimerSummary = computed(() => !showTimerDetails.value && (timerRunning.value || hasRecordedDuration.value))
|
|
125
|
-
const showDetailRow = computed(() => showAnnotationEditor.value || showTimerDetails.value)
|
|
126
126
|
|
|
127
127
|
function clearPendingFocusOutCheck() {
|
|
128
128
|
if (focusOutCheckTimer) {
|
|
@@ -164,6 +164,7 @@ export const AimdStepField = defineComponent({
|
|
|
164
164
|
|
|
165
165
|
function openAnnotationDetail() {
|
|
166
166
|
annotationExpanded.value = true
|
|
167
|
+
scrollDetailsIntoView()
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
function openTimerDetail() {
|
|
@@ -175,27 +176,44 @@ export const AimdStepField = defineComponent({
|
|
|
175
176
|
event.preventDefault()
|
|
176
177
|
}
|
|
177
178
|
|
|
179
|
+
function scrollDetailsIntoView() {
|
|
180
|
+
void nextTick(() => {
|
|
181
|
+
const target = annotationDetailsEl.value
|
|
182
|
+
if (typeof target?.scrollIntoView !== "function") {
|
|
183
|
+
return
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
target.scrollIntoView({
|
|
187
|
+
block: "nearest",
|
|
188
|
+
inline: "nearest",
|
|
189
|
+
behavior: "smooth",
|
|
190
|
+
})
|
|
191
|
+
})
|
|
192
|
+
}
|
|
193
|
+
|
|
178
194
|
return () => {
|
|
179
195
|
const node = props.node
|
|
180
196
|
const id = node.id
|
|
181
197
|
const state = props.state
|
|
182
198
|
const stepNumber = node.step || "?"
|
|
183
199
|
const hasCheck = Boolean(node.check)
|
|
200
|
+
const hasBody = props.bodyNodes.length > 0
|
|
184
201
|
const disabled = props.disabled
|
|
185
202
|
const extraClasses = props.extraClasses
|
|
186
203
|
const canResetTimer = hasRecordedDuration.value || timerRunning.value
|
|
187
204
|
const startButtonLabel = timerRunning.value
|
|
188
205
|
? props.messages.step.pauseTimer
|
|
189
206
|
: (hasRecordedDuration.value ? props.messages.step.resumeTimer : props.messages.step.startTimer)
|
|
190
|
-
const
|
|
207
|
+
const timerDetailChildren: VNodeChild[] = []
|
|
208
|
+
const annotationDetailChildren: VNodeChild[] = []
|
|
191
209
|
const headerMetaChildren = []
|
|
192
210
|
const headerActionChildren = []
|
|
193
211
|
|
|
194
212
|
if (showTimerDetails.value) {
|
|
195
|
-
const
|
|
213
|
+
const timerBadgeChildren: VNodeChild[] = []
|
|
196
214
|
|
|
197
215
|
if (countdownEnabled.value && countdownLabel.value) {
|
|
198
|
-
|
|
216
|
+
timerBadgeChildren.push(
|
|
199
217
|
h("span", {
|
|
200
218
|
class: [
|
|
201
219
|
"aimd-step-timer__hero",
|
|
@@ -211,7 +229,7 @@ export const AimdStepField = defineComponent({
|
|
|
211
229
|
}
|
|
212
230
|
|
|
213
231
|
if (showElapsedDetail.value) {
|
|
214
|
-
|
|
232
|
+
timerBadgeChildren.push(
|
|
215
233
|
h("span", {
|
|
216
234
|
class: [
|
|
217
235
|
"aimd-step-timer__pill",
|
|
@@ -223,11 +241,11 @@ export const AimdStepField = defineComponent({
|
|
|
223
241
|
)
|
|
224
242
|
}
|
|
225
243
|
|
|
226
|
-
|
|
244
|
+
timerDetailChildren.push(
|
|
227
245
|
h("span", {
|
|
228
246
|
class: "aimd-step-field__detail aimd-step-field__detail--timer",
|
|
229
247
|
}, [
|
|
230
|
-
...
|
|
248
|
+
...timerBadgeChildren,
|
|
231
249
|
!disabled
|
|
232
250
|
? h("span", { class: "aimd-step-timer__controls" }, [
|
|
233
251
|
h("button", {
|
|
@@ -248,7 +266,7 @@ export const AimdStepField = defineComponent({
|
|
|
248
266
|
}
|
|
249
267
|
|
|
250
268
|
if (showAnnotationEditor.value) {
|
|
251
|
-
|
|
269
|
+
annotationDetailChildren.push(
|
|
252
270
|
h("span", {
|
|
253
271
|
class: "aimd-step-field__detail aimd-step-field__detail--annotation",
|
|
254
272
|
}, [
|
|
@@ -256,7 +274,6 @@ export const AimdStepField = defineComponent({
|
|
|
256
274
|
class: "aimd-step-field__annotation-editor",
|
|
257
275
|
disabled,
|
|
258
276
|
locale: props.locale,
|
|
259
|
-
minHeight: 220,
|
|
260
277
|
modelValue: state.annotation || "",
|
|
261
278
|
"onUpdate:modelValue": (value: string) => {
|
|
262
279
|
emit("annotation-change", {
|
|
@@ -319,7 +336,7 @@ export const AimdStepField = defineComponent({
|
|
|
319
336
|
)
|
|
320
337
|
}
|
|
321
338
|
|
|
322
|
-
if (!disabled && !showAnnotationEditor.value) {
|
|
339
|
+
if (!disabled && !hasBody && !showAnnotationEditor.value) {
|
|
323
340
|
headerActionChildren.push(
|
|
324
341
|
h("button", {
|
|
325
342
|
type: "button",
|
|
@@ -342,7 +359,37 @@ export const AimdStepField = defineComponent({
|
|
|
342
359
|
}
|
|
343
360
|
|
|
344
361
|
const bodyChildren = props.bodyNodes.length > 0
|
|
345
|
-
? h("div", { class: "aimd-step-field__body" }, props.bodyNodes)
|
|
362
|
+
? h("div", { key: "body", class: "aimd-step-field__body" }, props.bodyNodes.slice())
|
|
363
|
+
: null
|
|
364
|
+
const bodyAnnotationAction = hasBody && !disabled && !showAnnotationEditor.value
|
|
365
|
+
? h("div", {
|
|
366
|
+
key: "body-annotation-actions",
|
|
367
|
+
class: "aimd-step-field__body-actions",
|
|
368
|
+
}, [
|
|
369
|
+
h("button", {
|
|
370
|
+
type: "button",
|
|
371
|
+
class: "aimd-step-timer__btn aimd-step-timer__btn--ghost aimd-step-field__toggle aimd-step-field__toggle--annotation aimd-step-field__body-action",
|
|
372
|
+
onMousedown: preventToggleFocus,
|
|
373
|
+
onClick: openAnnotationDetail,
|
|
374
|
+
}, props.messages.step.annotationToggle),
|
|
375
|
+
])
|
|
376
|
+
: null
|
|
377
|
+
const timerDetailSlot = timerDetailChildren.length > 0
|
|
378
|
+
? h("div", {
|
|
379
|
+
key: "timer-details-slot",
|
|
380
|
+
class: "aimd-step-field__details-slot aimd-step-field__details-slot--timer",
|
|
381
|
+
}, [
|
|
382
|
+
h("div", { class: "aimd-step-field__details" }, timerDetailChildren),
|
|
383
|
+
])
|
|
384
|
+
: null
|
|
385
|
+
const annotationDetailSlot = annotationDetailChildren.length > 0
|
|
386
|
+
? h("div", {
|
|
387
|
+
key: "annotation-details-slot",
|
|
388
|
+
ref: annotationDetailsEl,
|
|
389
|
+
class: "aimd-step-field__details-slot aimd-step-field__details-slot--annotation",
|
|
390
|
+
}, [
|
|
391
|
+
h("div", { class: "aimd-step-field__details" }, annotationDetailChildren),
|
|
392
|
+
])
|
|
346
393
|
: null
|
|
347
394
|
|
|
348
395
|
return h("div", {
|
|
@@ -352,6 +399,7 @@ export const AimdStepField = defineComponent({
|
|
|
352
399
|
onFocusout: handleFocusOut,
|
|
353
400
|
}, [
|
|
354
401
|
h("div", {
|
|
402
|
+
key: "main",
|
|
355
403
|
class: "aimd-step-field__main",
|
|
356
404
|
}, [
|
|
357
405
|
h("div", {
|
|
@@ -363,10 +411,10 @@ export const AimdStepField = defineComponent({
|
|
|
363
411
|
}, headerActionChildren)
|
|
364
412
|
: null,
|
|
365
413
|
]),
|
|
414
|
+
timerDetailSlot,
|
|
366
415
|
bodyChildren,
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
: null,
|
|
416
|
+
bodyAnnotationAction,
|
|
417
|
+
annotationDetailSlot,
|
|
370
418
|
])
|
|
371
419
|
}
|
|
372
420
|
},
|
|
@@ -380,10 +428,82 @@ export const AimdCheckField = defineComponent({
|
|
|
380
428
|
bodyNodes: { type: Array as PropType<VNodeChild[]>, default: () => [] },
|
|
381
429
|
disabled: { type: Boolean, default: false },
|
|
382
430
|
extraClasses: { type: Array as PropType<string[]>, default: () => [] },
|
|
431
|
+
locale: { type: String, default: "en-US" },
|
|
383
432
|
messages: { type: Object as PropType<AimdRecorderMessages>, required: true },
|
|
384
433
|
},
|
|
385
434
|
emits: ["check-change", "annotation-change", "blur"],
|
|
386
435
|
setup(props, { emit }) {
|
|
436
|
+
const rootEl = ref<HTMLElement | null>(null)
|
|
437
|
+
const detailsEl = ref<HTMLElement | null>(null)
|
|
438
|
+
const annotationExpanded = ref(false)
|
|
439
|
+
let focusOutCheckTimer: ReturnType<typeof setTimeout> | null = null
|
|
440
|
+
|
|
441
|
+
const hasAnnotation = computed(() => Boolean(props.state.annotation?.trim()))
|
|
442
|
+
const showAnnotationEditor = computed(() => hasAnnotation.value || annotationExpanded.value)
|
|
443
|
+
|
|
444
|
+
function clearPendingFocusOutCheck() {
|
|
445
|
+
if (focusOutCheckTimer) {
|
|
446
|
+
clearTimeout(focusOutCheckTimer)
|
|
447
|
+
focusOutCheckTimer = null
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
function collapseTransientDetails() {
|
|
452
|
+
if (!hasAnnotation.value) {
|
|
453
|
+
annotationExpanded.value = false
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
function handleFocusIn() {
|
|
458
|
+
clearPendingFocusOutCheck()
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function handleFocusOut(event: FocusEvent) {
|
|
462
|
+
const nextTarget = event.relatedTarget
|
|
463
|
+
if (nextTarget instanceof Node && rootEl.value?.contains(nextTarget)) {
|
|
464
|
+
return
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
clearPendingFocusOutCheck()
|
|
468
|
+
focusOutCheckTimer = setTimeout(() => {
|
|
469
|
+
focusOutCheckTimer = null
|
|
470
|
+
const activeElement = typeof document !== "undefined" ? document.activeElement : null
|
|
471
|
+
if (activeElement instanceof Node && rootEl.value?.contains(activeElement)) {
|
|
472
|
+
return
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
collapseTransientDetails()
|
|
476
|
+
}, 0)
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
function openAnnotationDetail() {
|
|
480
|
+
annotationExpanded.value = true
|
|
481
|
+
scrollDetailsIntoView()
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
function preventToggleFocus(event: MouseEvent) {
|
|
485
|
+
event.preventDefault()
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
function scrollDetailsIntoView() {
|
|
489
|
+
void nextTick(() => {
|
|
490
|
+
const target = detailsEl.value
|
|
491
|
+
if (typeof target?.scrollIntoView !== "function") {
|
|
492
|
+
return
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
target.scrollIntoView({
|
|
496
|
+
block: "nearest",
|
|
497
|
+
inline: "nearest",
|
|
498
|
+
behavior: "smooth",
|
|
499
|
+
})
|
|
500
|
+
})
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
onBeforeUnmount(() => {
|
|
504
|
+
clearPendingFocusOutCheck()
|
|
505
|
+
})
|
|
506
|
+
|
|
387
507
|
return () => {
|
|
388
508
|
const node = props.node
|
|
389
509
|
const id = node.id
|
|
@@ -393,57 +513,91 @@ export const AimdCheckField = defineComponent({
|
|
|
393
513
|
const hasBody = props.bodyNodes.length > 0
|
|
394
514
|
const showCheckedMessage = Boolean(state.checked && node.checked_message)
|
|
395
515
|
const fallbackLabel = node.label || id
|
|
516
|
+
const statusClass = state.checked ? "aimd-rec-inline--check-passed" : "aimd-rec-inline--check-open"
|
|
517
|
+
const bodyClass = hasBody ? "aimd-rec-inline--check-with-body" : "aimd-rec-inline--check-bodyless"
|
|
518
|
+
const headerActionChildren = !disabled && !showAnnotationEditor.value
|
|
519
|
+
? [
|
|
520
|
+
h("button", {
|
|
521
|
+
type: "button",
|
|
522
|
+
class: "aimd-step-timer__btn aimd-step-timer__btn--ghost aimd-check-field__toggle-btn",
|
|
523
|
+
onMousedown: preventToggleFocus,
|
|
524
|
+
onClick: openAnnotationDetail,
|
|
525
|
+
}, props.messages.check.annotationPlaceholder),
|
|
526
|
+
]
|
|
527
|
+
: []
|
|
528
|
+
const detailChildren = showAnnotationEditor.value
|
|
529
|
+
? [
|
|
530
|
+
h("span", {
|
|
531
|
+
class: "aimd-check-field__detail aimd-check-field__detail--annotation",
|
|
532
|
+
}, [
|
|
533
|
+
h(AimdMarkdownNoteField, {
|
|
534
|
+
class: "aimd-check-field__annotation-editor",
|
|
535
|
+
disabled,
|
|
536
|
+
locale: props.locale,
|
|
537
|
+
modelValue: state.annotation || "",
|
|
538
|
+
"onUpdate:modelValue": (value: string) => {
|
|
539
|
+
emit("annotation-change", {
|
|
540
|
+
id,
|
|
541
|
+
value,
|
|
542
|
+
})
|
|
543
|
+
},
|
|
544
|
+
onClose: () => {
|
|
545
|
+
annotationExpanded.value = false
|
|
546
|
+
emit("blur", { id })
|
|
547
|
+
},
|
|
548
|
+
onBlur: () => emit("blur", { id }),
|
|
549
|
+
}),
|
|
550
|
+
]),
|
|
551
|
+
]
|
|
552
|
+
: []
|
|
396
553
|
|
|
397
554
|
return h("div", {
|
|
398
|
-
|
|
555
|
+
ref: rootEl,
|
|
556
|
+
class: ["aimd-rec-inline aimd-rec-inline--check aimd-field aimd-field--check", statusClass, bodyClass, ...extraClasses],
|
|
557
|
+
onFocusin: handleFocusIn,
|
|
558
|
+
onFocusout: handleFocusOut,
|
|
399
559
|
}, [
|
|
400
560
|
h("div", { class: "aimd-check-field__main" }, [
|
|
401
|
-
h("
|
|
402
|
-
h("
|
|
403
|
-
"
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
561
|
+
h("div", { class: "aimd-check-field__header" }, [
|
|
562
|
+
h("label", { class: "aimd-rec-inline__check-wrap aimd-check-field__toggle" }, [
|
|
563
|
+
h("input", {
|
|
564
|
+
"data-rec-focus-key": `check:${id}:checked`,
|
|
565
|
+
type: "checkbox",
|
|
566
|
+
class: "aimd-checkbox",
|
|
567
|
+
disabled,
|
|
568
|
+
checked: Boolean(state.checked),
|
|
569
|
+
onChange: (event: Event) => {
|
|
570
|
+
emit("check-change", {
|
|
571
|
+
id,
|
|
572
|
+
value: (event.target as HTMLInputElement).checked,
|
|
573
|
+
})
|
|
574
|
+
},
|
|
575
|
+
onBlur: () => emit("blur", { id }),
|
|
576
|
+
}),
|
|
577
|
+
h("span", { class: "aimd-field__scope" }, getAimdRecorderScopeLabel("check", props.messages)),
|
|
578
|
+
!hasBody
|
|
579
|
+
? h("span", { class: "aimd-field__name aimd-check-field__key" }, fallbackLabel)
|
|
580
|
+
: null,
|
|
581
|
+
]),
|
|
582
|
+
headerActionChildren.length > 0
|
|
583
|
+
? h("div", { class: "aimd-check-field__actions" }, headerActionChildren)
|
|
584
|
+
: null,
|
|
585
|
+
]),
|
|
421
586
|
hasBody
|
|
422
587
|
? h("div", {
|
|
423
588
|
class: [
|
|
424
589
|
"aimd-check-field__body",
|
|
425
590
|
state.checked ? "aimd-check-field__body--checked" : "",
|
|
426
591
|
],
|
|
427
|
-
}, props.bodyNodes)
|
|
592
|
+
}, props.bodyNodes.slice())
|
|
428
593
|
: null,
|
|
429
594
|
]),
|
|
430
595
|
showCheckedMessage
|
|
431
596
|
? h("div", { class: "aimd-check-field__banner" }, node.checked_message)
|
|
432
597
|
: null,
|
|
433
|
-
|
|
434
|
-
"
|
|
435
|
-
|
|
436
|
-
disabled,
|
|
437
|
-
placeholder: props.messages.check.annotationPlaceholder,
|
|
438
|
-
value: state.annotation || "",
|
|
439
|
-
onInput: (event: Event) => {
|
|
440
|
-
emit("annotation-change", {
|
|
441
|
-
id,
|
|
442
|
-
value: (event.target as HTMLInputElement).value,
|
|
443
|
-
})
|
|
444
|
-
},
|
|
445
|
-
onBlur: () => emit("blur", { id }),
|
|
446
|
-
}),
|
|
598
|
+
detailChildren.length > 0
|
|
599
|
+
? h("div", { ref: detailsEl, class: "aimd-check-field__details" }, detailChildren)
|
|
600
|
+
: null,
|
|
447
601
|
])
|
|
448
602
|
}
|
|
449
603
|
},
|