+ ?inert=${showModal || inertContentSignal.value}
+ >
{
touch-target="none"
style="margin-inline-end: 16px;"
.checked=${!!knob.latestValue}
- @change="${valueChanged}">
+ @change="${valueChanged}"
+ >
${knob.name}
@@ -51,7 +52,7 @@ export function boolInput(): KnobUi {
*/
@customElement('knob-color-selector')
export class KnobColorSelector extends LitElement {
- static override styles = css`
+ static styles = css`
:host {
display: inline-block;
position: relative;
@@ -111,7 +112,7 @@ export class KnobColorSelector extends LitElement {
private internalValue = '';
- @property({type: Boolean}) hasAlpha = false;
+ @property({ type: Boolean }) hasAlpha = false;
set value(val: string) {
const oldVal = this.internalValue;
@@ -119,12 +120,12 @@ export class KnobColorSelector extends LitElement {
this.requestUpdate('value', oldVal);
}
- @property({type: String, reflect: true})
+ @property({ type: String, reflect: true })
get value() {
return this.internalValue;
}
- override render() {
+ render() {
return html`
${this.hasAlpha ? this.renderTextInput() : this.renderColorInput()}
@@ -132,7 +133,8 @@ export class KnobColorSelector extends LitElement {
{
this.hasAlpha = !this.hasAlpha;
- }}>
+ }}
+ >
${this.hasAlpha ? 'rgba' : 'rgb'}
`;
@@ -143,7 +145,8 @@ export class KnobColorSelector extends LitElement {
style=${styleMap(sharedTextFieldStyles)}
.value=${this.value}
@change=${this.propagateEvt}
- @input=${this.onInput}>`;
+ @input=${this.onInput}
+ >`;
}
private renderColorInput() {
@@ -158,7 +161,8 @@ export class KnobColorSelector extends LitElement {
id="color-picker"
.value=${this.value}
@change=${this.propagateEvt}
- @input=${this.onInput} />
+ @input=${this.onInput}
+ />
`;
}
@@ -176,17 +180,17 @@ export class KnobColorSelector extends LitElement {
this.dispatchEvent(newEvt);
}
- override click() {
+ click() {
const input = this.renderRoot!.querySelector(
- 'input,md-filled-text-field',
+ 'input,md-filled-text-field'
) as HTMLElement;
input.click();
input.focus();
}
- override focus() {
+ focus() {
const input = this.renderRoot!.querySelector(
- 'input,md-filled-text-field',
+ 'input,md-filled-text-field'
) as HTMLElement;
input.focus();
}
@@ -226,7 +230,8 @@ export function colorPicker(opts?: ColorPickerOpts): KnobUi {
+ @input=${valueChanged}
+ >
${knob.name}
@@ -245,7 +250,7 @@ const sharedTextFieldStyles: StyleInfo = {
'--md-filled-field-trailing-space': '8px',
'--md-filled-field-top-space': '4px',
'--md-filled-field-bottom-space': '4px',
- 'width': '150px',
+ width: '150px',
'min-width': '150px',
};
@@ -272,7 +277,8 @@ export function textInput(options?: TextInputOptions): KnobUi {
+ @input="${valueChanged}"
+ >
${knob.name}
@@ -313,7 +319,8 @@ export function numberInput(opts?: NumberInputOpts): KnobUiOn this page: