mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-03 11:43:57 +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 label;
|
||||||
|
|
||||||
|
export let disabled = false;
|
||||||
|
|
||||||
$: renderedValue = value ?? inheritedValue;
|
$: renderedValue = value ?? inheritedValue;
|
||||||
$: isInherited = inheritedValue != null && value == null;
|
$: isInherited = inheritedValue != null && value == null;
|
||||||
|
|
||||||
@@ -30,11 +32,12 @@
|
|||||||
<div
|
<div
|
||||||
class="wrapper"
|
class="wrapper"
|
||||||
on:click|preventDefault|stopPropagation={() => {
|
on:click|preventDefault|stopPropagation={() => {
|
||||||
|
if (disabled) return;
|
||||||
onChange(getNextValue());
|
onChange(getNextValue());
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div class="checkbox" {...$$restProps} class:checked={!!renderedValue} class:isInherited />
|
<div class="checkbox" {...$$restProps} class:checked={!!renderedValue} class:isInherited class:disabled />
|
||||||
<div class="label">
|
<div class="label" class:disabled>
|
||||||
{label}
|
{label}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -51,6 +54,11 @@
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.label.disabled {
|
||||||
|
cursor: not-allowed;
|
||||||
|
color: var(--theme-font-3);
|
||||||
|
}
|
||||||
|
|
||||||
.checkbox {
|
.checkbox {
|
||||||
width: 14px !important;
|
width: 14px !important;
|
||||||
height: 14px !important;
|
height: 14px !important;
|
||||||
@@ -76,4 +84,9 @@
|
|||||||
.isInherited {
|
.isInherited {
|
||||||
background: var(--theme-bg-2) !important;
|
background: var(--theme-bg-2) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.checkbox.disabled {
|
||||||
|
background: var(--theme-bg-2) !important;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user