mirror of
https://github.com/rio-labs/rio.git
synced 2026-01-07 21:59:44 -06:00
more work on input box styles
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { markEventAsHandled, stopPropagation } from "./eventHandling";
|
||||
import { createUniqueId } from "./utils";
|
||||
|
||||
export type InputBoxStyle = "rectangular" | "pill";
|
||||
|
||||
/// A text input field providing the following features and more:
|
||||
///
|
||||
@@ -33,7 +34,10 @@ export class InputBox {
|
||||
connectClickHandlers?: boolean;
|
||||
} = {}) {
|
||||
this.outerElement = document.createElement("div");
|
||||
this.outerElement.classList.add("rio-input-box");
|
||||
this.outerElement.classList.add(
|
||||
"rio-input-box",
|
||||
"rio-input-box-style-rectangular"
|
||||
);
|
||||
|
||||
this.outerElement.innerHTML = `
|
||||
<div class="rio-input-box-padding"></div>
|
||||
@@ -229,6 +233,15 @@ export class InputBox {
|
||||
}
|
||||
}
|
||||
|
||||
set style(style: InputBoxStyle) {
|
||||
this.outerElement.classList.remove(
|
||||
"rio-input-box-style-rectangular",
|
||||
"rio-input-box-style-pill"
|
||||
);
|
||||
|
||||
this.outerElement.classList.add(`rio-input-box-style-${style}`);
|
||||
}
|
||||
|
||||
get isSensitive(): boolean {
|
||||
return !this._inputElement.disabled;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user