mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 11:16:01 +00:00
SYNC: roles UX
This commit is contained in:
committed by
Diflow
parent
879c89a285
commit
97923b19bf
@@ -8,6 +8,8 @@
|
||||
|
||||
export let label;
|
||||
|
||||
export let disabled = false;
|
||||
|
||||
$: renderedValue = value ?? inheritedValue;
|
||||
$: isInherited = inheritedValue != null && value == null;
|
||||
|
||||
@@ -30,11 +32,12 @@
|
||||
<div
|
||||
class="wrapper"
|
||||
on:click|preventDefault|stopPropagation={() => {
|
||||
if (disabled) return;
|
||||
onChange(getNextValue());
|
||||
}}
|
||||
>
|
||||
<div class="checkbox" {...$$restProps} class:checked={!!renderedValue} class:isInherited />
|
||||
<div class="label">
|
||||
<div class="checkbox" {...$$restProps} class:checked={!!renderedValue} class:isInherited class:disabled />
|
||||
<div class="label" class:disabled>
|
||||
{label}
|
||||
</div>
|
||||
</div>
|
||||
@@ -51,6 +54,11 @@
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.label.disabled {
|
||||
cursor: not-allowed;
|
||||
color: var(--theme-font-3);
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
width: 14px !important;
|
||||
height: 14px !important;
|
||||
@@ -76,4 +84,9 @@
|
||||
.isInherited {
|
||||
background: var(--theme-bg-2) !important;
|
||||
}
|
||||
|
||||
.checkbox.disabled {
|
||||
background: var(--theme-bg-2) !important;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user