a11y(filter-editor): label type and operator controls

Associate each fixed select with a stable per-condition label while keeping the compact visual layout unchanged.
This commit is contained in:
翅膀 committed 2026-10-17 07:56:24 +08:00
1 parent 54b2944dd4
commit 628d5af5f3
2 files changed
+7

No files matched your search

+5
View File
@@ -23,6 +23,7 @@ const emit = defineEmits<{ (e: "remove"): void }>();
const { t, locale } = useI18n();
const { confirm } = useConfirm();
const fieldId = `filter-node-${useId()}`;
const scopeEvents = inject(
FILTER_SCOPE_EVENTS,
computed((): string[] => []),
@@ -141,7 +142,9 @@ async function remove(): Promise<void> {
}"
>
<div class="leaf-type">
<label :for="`${fieldId}-type`" class="sr-only">{{ t("routeEditor.filterType") }}</label>
<RcSelect
:id="`${fieldId}-type`"
:model-value="node.leaf.type"
:options="typeOptions"
@update:model-value="setType"
@@ -158,7 +161,9 @@ async function remove(): Promise<void> {
/>
</div>
<div v-if="showOp" class="leaf-op">
<label :for="`${fieldId}-op`" class="sr-only">{{ t("routeEditor.op") }}</label>
<RcSelect
:id="`${fieldId}-op`"
:model-value="node.leaf.op"
:options="opOptions"
:title="t('routeEditor.op')"
+2
View File
@@ -270,6 +270,7 @@ const en: Dict = {
"routeEditor.errDraft": "Add (press Enter) or clear the filter value still being typed",
"routeEditor.errInvalidValue": 'Invalid value "{value}": {reason}',
"routeEditor.op": "Operator",
"routeEditor.filterType": "Filter type",
"routeEditor.pathPlaceholder": "payload.path",
"routeEditor.valuesPlaceholder": "Type a value and press Enter",
"routeEditor.testMatch": "Test match",
@@ -702,6 +703,7 @@ const zh: Dict = {
"routeEditor.errDraft": "请先确认(回车)或清除尚未添加的过滤值",
"routeEditor.errInvalidValue": "无效的值“{value}”:{reason}",
"routeEditor.op": "操作符",
"routeEditor.filterType": "过滤类型",
"routeEditor.pathPlaceholder": "payload.path",
"routeEditor.valuesPlaceholder": "输入值后回车",
"routeEditor.testMatch": "测试匹配",