diff --git a/src/ui/src/builder/settings/BuilderSettingsProperties.vue b/src/ui/src/builder/settings/BuilderSettingsProperties.vue index f89d6ae19..3cb799367 100644 --- a/src/ui/src/builder/settings/BuilderSettingsProperties.vue +++ b/src/ui/src/builder/settings/BuilderSettingsProperties.vue @@ -54,7 +54,10 @@ > { [injectionKeys.evaluatedFields as symbol]: { text: ref(text), seed: ref(1), - useMarkdown: ref("no"), - rotateHue: ref("yes"), + useMarkdown: ref(false), + rotateHue: ref(true), referenceColor: ref(WdsColor.Blue5), - copyButtons: ref("yes"), + copyButtons: ref(true), }, }, }, @@ -73,10 +73,10 @@ describe("CoreAnnotatedText", async () => { [injectionKeys.evaluatedFields as symbol]: { text: ref(text), seed: ref(1), - useMarkdown: ref("yes"), - rotateHue: ref("yes"), + useMarkdown: ref(true), + rotateHue: ref(true), referenceColor: ref(WdsColor.Blue5), - copyButtons: ref("yes"), + copyButtons: ref(true), }, }, }, diff --git a/src/ui/src/components/core/content/CoreAnnotatedText.vue b/src/ui/src/components/core/content/CoreAnnotatedText.vue index 6cc6e584e..28f6f1503 100644 --- a/src/ui/src/components/core/content/CoreAnnotatedText.vue +++ b/src/ui/src/components/core/content/CoreAnnotatedText.vue @@ -27,7 +27,7 @@ @@ -36,6 +36,7 @@ + diff --git a/src/ui/src/components/core/layout/CoreSidebar.vue b/src/ui/src/components/core/layout/CoreSidebar.vue index 946ec7369..1b1511178 100644 --- a/src/ui/src/components/core/layout/CoreSidebar.vue +++ b/src/ui/src/components/core/layout/CoreSidebar.vue @@ -75,7 +75,7 @@ import { computed, inject, onMounted, Ref, ref, watch } from "vue"; import injectionKeys from "@/injectionKeys"; const fields = inject(injectionKeys.evaluatedFields); -const isCollapsed: Ref = ref(fields.startCollapsed.value == "yes"); +const isCollapsed: Ref = ref(fields.startCollapsed.value); const wf = inject(injectionKeys.core); const ssbm = inject(injectionKeys.builderManager); const componentId = inject(injectionKeys.componentId); diff --git a/src/ui/src/components/core/layout/CoreStep.vue b/src/ui/src/components/core/layout/CoreStep.vue index 28efff027..836ff9ace 100644 --- a/src/ui/src/components/core/layout/CoreStep.vue +++ b/src/ui/src/components/core/layout/CoreStep.vue @@ -18,7 +18,7 @@ :disabled="!isBeingEdited" :class="{ active: isStepActive, - completed: fields.isCompleted.value == 'yes', + completed: fields.isCompleted.value, }" stepindex="0" @click="activateStep" @@ -28,11 +28,11 @@
done @@ -72,6 +72,7 @@ import { contentHAlign, cssClasses, contentPadding, + baseYesNoField, } from "@/renderer/sharedStyleFields"; import { onBeforeUnmount } from "vue"; @@ -97,14 +98,10 @@ export default { default: "16px", }, isCompleted: { + ...baseYesNoField, name: "Completed", desc: "Use a state reference to dynamically mark this step as complete.", default: "no", - type: FieldType.Text, - options: { - yes: "Yes", - no: "No", - }, }, contentHAlign, cssClasses, @@ -203,7 +200,7 @@ function activateNextStep() { const subsequentSteps = stepContainerData.value.steps.slice( currentStepIndex + 1, ); - let nextStep = subsequentSteps.find((step) => step.isCompleted != "yes"); + let nextStep = subsequentSteps.find((step) => !step.isCompleted); if (!nextStep) { const lastStep = stepContainerData.value.steps.at(-1); nextStep = lastStep; @@ -222,7 +219,7 @@ function checkIfStepIsParent(childId: Component["id"]): boolean { } function activateDefaultStep() { - if (fields.isCompleted.value != "yes") { + if (!fields.isCompleted.value) { activateStep(); return; } @@ -270,7 +267,7 @@ Prevent a step of being active while completed. watch([isStepActive, fields.isCompleted], () => { if (isBeingEdited.value) return; if (!isStepActive.value) return; - if (fields.isCompleted.value == "yes") { + if (fields.isCompleted.value) { activateNextStep(); } }); @@ -278,9 +275,9 @@ watch([isStepActive, fields.isCompleted], () => { /* Activate any step that was previously complete but switched to non-completed. */ -watch(fields.isCompleted, (value: string, oldValue: string) => { - if (oldValue !== "yes") return; - if (value !== "no") return; +watch(fields.isCompleted, (value: boolean, oldValue: boolean) => { + if (!oldValue) return; + if (value) return; activateDefaultStep(); }); diff --git a/src/ui/src/components/core/other/CoreButton.vue b/src/ui/src/components/core/other/CoreButton.vue index 8d572f697..9f5bf0d1e 100644 --- a/src/ui/src/components/core/other/CoreButton.vue +++ b/src/ui/src/components/core/other/CoreButton.vue @@ -25,6 +25,7 @@ import { buttonShadow, separatorColor, cssClasses, + baseYesNoField, } from "@/renderer/sharedStyleFields"; import { watch } from "vue"; import { getClick } from "@/renderer/syntheticEvents"; @@ -57,13 +58,9 @@ export default { type: FieldType.Text, }, isDisabled: { + ...baseYesNoField, name: "Disabled", default: "no", - type: FieldType.Text, - options: { - yes: "Yes", - no: "No", - }, desc: "Disables all event handlers.", }, buttonColor, @@ -92,8 +89,8 @@ const isDisabled = inject(injectionKeys.isDisabled); watch( fields.isDisabled, - (newFieldValue: string) => { - isDisabled.value = newFieldValue == "yes"; + (newFieldValue: boolean) => { + isDisabled.value = newFieldValue; }, { immediate: true, diff --git a/src/ui/src/components/core/other/CorePagination.vue b/src/ui/src/components/core/other/CorePagination.vue index 69b9dc968..bcac48baa 100644 --- a/src/ui/src/components/core/other/CorePagination.vue +++ b/src/ui/src/components/core/other/CorePagination.vue @@ -74,6 +74,7 @@