readonly css
This commit is contained in:
parent
fee9a9d65d
commit
c169a73764
|
@ -25,16 +25,12 @@
|
||||||
class:is-invalid={!!error}
|
class:is-invalid={!!error}
|
||||||
class:checked={value}
|
class:checked={value}
|
||||||
class:is-indeterminate={indeterminate}
|
class:is-indeterminate={indeterminate}
|
||||||
|
class:readonly
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
checked={value}
|
checked={value}
|
||||||
{disabled}
|
{disabled}
|
||||||
on:change={onChange}
|
on:change={onChange}
|
||||||
on:click={e => {
|
|
||||||
if (readonly) {
|
|
||||||
e.preventDefault()
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
class="spectrum-Checkbox-input"
|
class="spectrum-Checkbox-input"
|
||||||
{id}
|
{id}
|
||||||
|
@ -74,4 +70,7 @@
|
||||||
.spectrum-Checkbox-input {
|
.spectrum-Checkbox-input {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
.readonly {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -35,17 +35,13 @@
|
||||||
title={getOptionLabel(option)}
|
title={getOptionLabel(option)}
|
||||||
class="spectrum-Checkbox spectrum-FieldGroup-item"
|
class="spectrum-Checkbox spectrum-FieldGroup-item"
|
||||||
class:is-invalid={!!error}
|
class:is-invalid={!!error}
|
||||||
|
class:readonly
|
||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
class="spectrum-Checkbox spectrum-Checkbox--sizeM spectrum-FieldGroup-item"
|
class="spectrum-Checkbox spectrum-Checkbox--sizeM spectrum-FieldGroup-item"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
on:change={onChange}
|
on:change={onChange}
|
||||||
on:click={e => {
|
|
||||||
if (readonly) {
|
|
||||||
e.preventDefault()
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
class="spectrum-Checkbox-input"
|
class="spectrum-Checkbox-input"
|
||||||
value={optionValue}
|
value={optionValue}
|
||||||
|
@ -72,4 +68,7 @@
|
||||||
.spectrum-Checkbox-input {
|
.spectrum-Checkbox-input {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
.readonly {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -41,14 +41,10 @@
|
||||||
title={getOptionTitle(option)}
|
title={getOptionTitle(option)}
|
||||||
class="spectrum-Radio spectrum-FieldGroup-item spectrum-Radio--emphasized"
|
class="spectrum-Radio spectrum-FieldGroup-item spectrum-Radio--emphasized"
|
||||||
class:is-invalid={!!error}
|
class:is-invalid={!!error}
|
||||||
|
class:readonly
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
on:change={onChange}
|
on:change={onChange}
|
||||||
on:click={e => {
|
|
||||||
if (readonly) {
|
|
||||||
e.preventDefault()
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
bind:group={value}
|
bind:group={value}
|
||||||
value={getOptionValue(option)}
|
value={getOptionValue(option)}
|
||||||
type="radio"
|
type="radio"
|
||||||
|
@ -68,4 +64,7 @@
|
||||||
.spectrum-Radio-input {
|
.spectrum-Radio-input {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
.readonly {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -78,6 +78,7 @@
|
||||||
contenteditable={$component.editing}
|
contenteditable={$component.editing}
|
||||||
on:blur={$component.editing ? updateLabel : null}
|
on:blur={$component.editing ? updateLabel : null}
|
||||||
class:hidden={!label}
|
class:hidden={!label}
|
||||||
|
class:readonly
|
||||||
for={fieldState?.fieldId}
|
for={fieldState?.fieldId}
|
||||||
class={`spectrum-FieldLabel spectrum-FieldLabel--sizeM spectrum-Form-itemLabel ${labelClass}`}
|
class={`spectrum-FieldLabel spectrum-FieldLabel--sizeM spectrum-Form-itemLabel ${labelClass}`}
|
||||||
>
|
>
|
||||||
|
@ -138,4 +139,7 @@
|
||||||
.spectrum-FieldLabel--left {
|
.spectrum-FieldLabel--left {
|
||||||
padding-right: var(--spectrum-global-dimension-size-200);
|
padding-right: var(--spectrum-global-dimension-size-200);
|
||||||
}
|
}
|
||||||
|
.readonly {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue