Skip to content

Commit

Permalink
deploy: bd335fb
Browse files Browse the repository at this point in the history
  • Loading branch information
SweetDealer committed Aug 23, 2024
1 parent db9caa6 commit 7bf60b0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
8 changes: 4 additions & 4 deletions index.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.bundle.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions tmp_tsoutput/SelectInput/SelectInput.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export default class SelectInput extends HTMLElement {
set comparator(arg: Function);
/** @param {boolean} isDisabled */
setDisabled(isDisabled: boolean): void;
/** @param {string} placeholderText */
setPlaceholder(placeholderText: string): void;
showDropdown(): void;
onShowDropdown(callback: any): void;
onChangeValue(callback: any): void;
Expand Down
6 changes: 5 additions & 1 deletion tmp_tsoutput/SelectInput/SelectInput.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KeyCode, safeHtml } from "../utils.js";
import { KeyCode } from "../utils.js";
export default class SelectInput extends HTMLElement {
#inputElement;
#dropdownElement;
Expand Down Expand Up @@ -27,6 +27,10 @@ export default class SelectInput extends HTMLElement {
this.toggleAttribute("disabled", isDisabled);
this.#inputElement.setDisabled(isDisabled);
}
/** @param {string} placeholderText */
setPlaceholder(placeholderText) {
this.#inputElement.setPlaceholder(placeholderText);
}
showDropdown() {
this.#dropdownElement.show();
this.#callbacks.onShowDropdown.forEach(callback => callback());
Expand Down
2 changes: 2 additions & 0 deletions tmp_tsoutput/TextInput/TextInput.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export default class TextInput extends HTMLElement {
focus(options: any): void;
/** @param {boolean} isDisabled */
setDisabled(isDisabled: boolean): void;
/** @param {string} placeholderText */
setPlaceholder(placeholderText: string): void;
#private;
}
export type InputValidator = import("../InputValidator.js").default;
7 changes: 6 additions & 1 deletion tmp_tsoutput/TextInput/TextInput.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-check
import TextInputValidityState from "./TextInputValidityState.js";
import { isFiniteNumber, KeyCode, safeHtml } from "../utils.js";
import { isFiniteNumber, KeyCode, safeHtml, safeText } from "../utils.js";
/**
* @typedef {import("../InputValidator.js").default} InputValidator
*/
Expand Down Expand Up @@ -116,6 +116,11 @@ export default class TextInput extends HTMLElement {
this.toggleAttribute("disabled", isDisabled);
this.#inputElement.toggleAttribute("disabled", isDisabled);
}
/** @param {string} placeholderText */
setPlaceholder(placeholderText) {
this.#inputElement.setAttribute('placeholder', safeText(placeholderText));
this.classList.add("placeholder-shown");
}
/** @param {KeyboardEvent} event */
#onKeyDown(event) {
if (this.#inputElement.type === "number" && (event.key === KeyCode.Up || event.key === KeyCode.Down))
Expand Down

0 comments on commit 7bf60b0

Please sign in to comment.