优化
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
@import './adminDensityTokens.css';
|
||||
@import './adminTextActions.css';
|
||||
|
||||
/* Explicit opt-in for approved dense business workspaces and teleported dialogs. */
|
||||
.admin-density, .admin-density-dialog, .admin-density-drawer {
|
||||
|
||||
@@ -486,12 +486,26 @@ describe('approved Admin density ownership', () => {
|
||||
})
|
||||
|
||||
it('keeps conditional shared consumers opt-in instead of enabling other menus', () => {
|
||||
const actionWeights = new Map<string, string>()
|
||||
cssRoot(read('styles/adminTextActions.css')).walkRules(rule => {
|
||||
rule.walkDecls('font-weight', declaration => { actionWeights.set(rule.selector, declaration.value) })
|
||||
})
|
||||
expect(actionWeights.get('.row-actions.admin-text-actions .el-button.el-button')).toBe('400')
|
||||
expect(actionWeights.get('.admin-text-actions.el-popper .el-dropdown-menu__item')).toBe('400')
|
||||
const dispatches = read('modules/overseas-warehouse/pages/DispatchesView.vue')
|
||||
expect(dispatches).toContain('appearance="integrated"')
|
||||
expect(dispatches).toContain('<template #filters><QueryToolbar')
|
||||
expect(dispatches).not.toContain('class="surface-panel table-panel"')
|
||||
const calendar = read('modules/sailing-calendar/pages/SailingCalendarView.vue')
|
||||
expect(calendar).toContain('appearance="integrated" :data="[]" :columns="[]" column-settings-mode="hide"')
|
||||
expect(calendar).toContain('<template #results>')
|
||||
expect(calendar).not.toContain('class="calendar-toolbar surface-panel"')
|
||||
expect(read('shared/components/DataTable.vue')).toContain('margin-left: var(--cc-list-action-sibling-margin, 8px)')
|
||||
expect(shared).toContain('.density-actions { --cc-list-action-sibling-margin: 0px;')
|
||||
expect(read('modules/loading-lists/components/LoadingListsView.vue')).toContain("'admin-density': isPreload")
|
||||
expect(read('modules/loading-lists/components/LoadingListsView.vue')).toContain('class="business-page loading-lists-page admin-density"')
|
||||
expect(read('modules/loading-lists/components/PalletLabelPrintDialog.vue')).toContain("'admin-density-dialog': dense")
|
||||
expect(read('modules/container-loading/components/ContainerSimulationCreate.vue')).toContain("'admin-density-dialog': dense")
|
||||
for (const file of ['loading-lists/components/LoadingListsView.vue', 'loading-lists/components/LoadingListDetailDrawer.vue', 'loading-lists/components/PalletLabelPrintDialog.vue', 'container-loading/components/ContainerSimulationCreate.vue']) {
|
||||
for (const file of ['loading-lists/components/LoadingListDetailDrawer.vue', 'loading-lists/components/PalletLabelPrintDialog.vue', 'container-loading/components/ContainerSimulationCreate.vue']) {
|
||||
const template = parse(read(`modules/${file}`)).descriptor.template!.ast!
|
||||
const visit = (nodes: typeof template.children) => {
|
||||
for (const node of nodes) {
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/* Explicit opt-in for table row actions and their teleported overflow menu only. */
|
||||
.admin-text-actions {
|
||||
--admin-text-action-color: #1677ff;
|
||||
--admin-text-action-danger: #dc2626;
|
||||
}
|
||||
.row-actions.admin-text-actions .el-button.el-button {
|
||||
--text-action-color: var(--admin-text-action-color);
|
||||
--el-button-text-color: var(--text-action-color);
|
||||
--el-button-hover-text-color: var(--text-action-color);
|
||||
--el-button-active-text-color: var(--text-action-color);
|
||||
--el-button-bg-color: transparent;
|
||||
--el-button-hover-bg-color: transparent;
|
||||
--el-button-active-bg-color: transparent;
|
||||
--el-button-border-color: transparent;
|
||||
--el-button-hover-border-color: transparent;
|
||||
--el-button-active-border-color: transparent;
|
||||
color: var(--text-action-color);
|
||||
font-weight: 400;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
.row-actions.admin-text-actions .el-button[data-tone="danger"],
|
||||
.row-actions.admin-text-actions .el-button.el-button--danger {
|
||||
--text-action-color: var(--admin-text-action-danger);
|
||||
}
|
||||
.row-actions.admin-text-actions .el-button.el-button:hover:not(:disabled),
|
||||
.row-actions.admin-text-actions .el-button.el-button:active:not(:disabled) {
|
||||
color: var(--text-action-color);
|
||||
border-color: transparent;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
.row-actions.admin-text-actions .el-button.el-button:focus-visible {
|
||||
outline: 2px solid var(--text-action-color);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
.row-actions.admin-text-actions .el-button.el-button:is(:disabled, .is-disabled) {
|
||||
color: var(--el-disabled-text-color, #a8abb2);
|
||||
border-color: transparent;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
.admin-text-actions.el-popper .el-dropdown-menu__item { color: var(--admin-text-action-color); font-weight: 400; text-decoration: none; }
|
||||
.admin-text-actions.el-popper .el-dropdown-menu__item.danger-menu-item { color: var(--admin-text-action-danger); }
|
||||
.admin-text-actions.el-popper .el-dropdown-menu__item.is-disabled { color: var(--el-disabled-text-color, #a8abb2); }
|
||||
Reference in New Issue
Block a user