1
0
Fork 0
mirror of synced 2024-10-01 09:38:55 +13:00

readonly css

This commit is contained in:
Mel O'Hagan 2023-11-07 09:19:29 +00:00
parent fee9a9d65d
commit c169a73764
4 changed files with 16 additions and 15 deletions

View file

@ -25,16 +25,12 @@
class:is-invalid={!!error}
class:checked={value}
class:is-indeterminate={indeterminate}
class:readonly
>
<input
checked={value}
{disabled}
on:change={onChange}
on:click={e => {
if (readonly) {
e.preventDefault()
}
}}
type="checkbox"
class="spectrum-Checkbox-input"
{id}
@ -74,4 +70,7 @@
.spectrum-Checkbox-input {
opacity: 0;
}
.readonly {
pointer-events: none;
}
</style>

View file

@ -35,17 +35,13 @@
title={getOptionLabel(option)}
class="spectrum-Checkbox spectrum-FieldGroup-item"
class:is-invalid={!!error}
class:readonly
>
<label
class="spectrum-Checkbox spectrum-Checkbox--sizeM spectrum-FieldGroup-item"
>
<input
on:change={onChange}
on:click={e => {
if (readonly) {
e.preventDefault()
}
}}
type="checkbox"
class="spectrum-Checkbox-input"
value={optionValue}
@ -72,4 +68,7 @@
.spectrum-Checkbox-input {
opacity: 0;
}
.readonly {
pointer-events: none;
}
</style>

View file

@ -41,14 +41,10 @@
title={getOptionTitle(option)}
class="spectrum-Radio spectrum-FieldGroup-item spectrum-Radio--emphasized"
class:is-invalid={!!error}
class:readonly
>
<input
on:change={onChange}
on:click={e => {
if (readonly) {
e.preventDefault()
}
}}
bind:group={value}
value={getOptionValue(option)}
type="radio"
@ -68,4 +64,7 @@
.spectrum-Radio-input {
opacity: 0;
}
.readonly {
pointer-events: none;
}
</style>

View file

@ -78,6 +78,7 @@
contenteditable={$component.editing}
on:blur={$component.editing ? updateLabel : null}
class:hidden={!label}
class:readonly
for={fieldState?.fieldId}
class={`spectrum-FieldLabel spectrum-FieldLabel--sizeM spectrum-Form-itemLabel ${labelClass}`}
>
@ -138,4 +139,7 @@
.spectrum-FieldLabel--left {
padding-right: var(--spectrum-global-dimension-size-200);
}
.readonly {
pointer-events: none;
}
</style>