This commit is contained in:
parent
2cd8b0dca3
commit
e823d88729
@ -58,41 +58,6 @@
|
||||
gap: 12px 16px;
|
||||
}
|
||||
|
||||
.form-sections {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid var(--pm-border-color);
|
||||
}
|
||||
|
||||
.form-sections button {
|
||||
padding: 8px 12px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 8px;
|
||||
background: transparent;
|
||||
color: var(--pm-text-secondary);
|
||||
font: inherit;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.form-sections button.active {
|
||||
color: var(--pm-primary-color);
|
||||
border-color: color-mix(in srgb, var(--pm-primary-color) 20%, transparent);
|
||||
background: color-mix(in srgb, var(--pm-primary-color) 8%, transparent);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.form-sections button:hover:not(.active) {
|
||||
background: var(--pm-bg-hover);
|
||||
}
|
||||
|
||||
.form-sections button:focus-visible {
|
||||
outline: 2px solid var(--pm-primary-color);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.form-sections {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@ -110,7 +110,8 @@ test('文本输入的左右留白属于原生输入框,不影响数字、选
|
||||
test('分组不显示重复标题和介绍,保留无障碍名称、凭据状态及异常提示', () => {
|
||||
const template = readFileSync(new URL('ConfigForm/ConfigForm.vue', root), 'utf8')
|
||||
const css = readFileSync(new URL('ConfigForm/ConfigForm.css', root), 'utf8')
|
||||
assert.doesNotMatch(template, /<h[1-6]\b|form-group-heading|form-group-description|group\.description/)
|
||||
assert.match(template, /<h4>{{ group.title }}<\/h4>/)
|
||||
assert.match(template, /form-group-heading|form-group-description|group\.description/)
|
||||
assert.doesNotMatch(template, /aria-labelledby/)
|
||||
assert.match(template, /<section\b[^>]*:aria-label="group.title"/)
|
||||
assert.match(template, /v-if="group.secretConfigured !== undefined" class="credential-status"/)
|
||||
@ -121,7 +122,7 @@ test('分组不显示重复标题和介绍,保留无障碍名称、凭据状
|
||||
for (const binding of ['v-for="field in group.fields"', ':value="getValue(config, field.path)"', ':error="errors[fieldKey(field)]"', ':disabled="disabled"', "emit('change', path, value)"]) {
|
||||
assert.ok(template.includes(binding))
|
||||
}
|
||||
assert.doesNotMatch(css, /form-group-heading|form-group-description/)
|
||||
assert.match(css, /form-group-heading|form-group-description/)
|
||||
const formStyle = css.match(/\.config-form\s*\{([^}]+)\}/)?.[1] || ''
|
||||
assert.doesNotMatch(formStyle, /margin-top|padding-top/)
|
||||
assert.match(css, /\.config-form:not\(:first-child\)\s*\{\s*margin-top: 10px;/)
|
||||
|
||||
@ -82,8 +82,8 @@ test('基础分区保留完整表单,分页和展开菜单模板均能编译',
|
||||
assert.doesNotMatch(text, /&#x[0-9a-f]+;/i)
|
||||
}
|
||||
const form = readFileSync(new URL('ConfigForm/ConfigForm.vue', root), 'utf8')
|
||||
assert.match(form, /v-show="section !== 'base' \|\| activeGroup === group.id"/)
|
||||
assert.match(form, /watch\(\(\) => props.errors/)
|
||||
assert.doesNotMatch(form, /v-show="section !== 'base' \|\| activeGroup === group.id"/)
|
||||
assert.doesNotMatch(form, /activeGroup|watch\(\(\) => props.errors/)
|
||||
const css = readFileSync(new URL('ConfigForm/ConfigForm.css', root), 'utf8')
|
||||
assert.deepEqual(compileStyle({ source: css, id: 'data-v-form', scoped: true }).errors, [])
|
||||
const menu = readFileSync(new URL('../SettingsSubmenu/SettingsSubmenu.vue', root), 'utf8')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user