aboutsummaryrefslogtreecommitdiff
path: root/input/checkboxes.d.ts
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-09-05 19:52:15 +0700
committerShulhan <ms@kilabit.info>2021-09-05 19:57:35 +0700
commit897d8bbdd89034d8a9bdc781de07c5492b340f1f (patch)
treef44d0001ac1b1e53e55cc9174a2791c39545027f /input/checkboxes.d.ts
parentb18cd3529299e03f5c14d9bf702f28c3f7acb4d0 (diff)
downloadpakakeh.ts-897d8bbdd89034d8a9bdc781de07c5492b340f1f.tar.xz
input: implement input for checkboxes
The WuiInputCheckboxes class can create an HTML input for selecting one or more item using checkbox. The class require the following options: label, name, and options; and optionally id, hint, is_disabled, and onChangeHandler. The onChangeHandler receive all checked values.
Diffstat (limited to 'input/checkboxes.d.ts')
-rw-r--r--input/checkboxes.d.ts32
1 files changed, 32 insertions, 0 deletions
diff --git a/input/checkboxes.d.ts b/input/checkboxes.d.ts
new file mode 100644
index 0000000..89a35d3
--- /dev/null
+++ b/input/checkboxes.d.ts
@@ -0,0 +1,32 @@
+import { WuiInputOption } from "./option.js";
+export interface WuiKeyValue {
+ [key: string]: string;
+}
+export interface WuiKeySelectOption {
+ [key: string]: WuiInputOption;
+}
+export interface WuiInputCheckboxesOpts {
+ label: string;
+ name: string;
+ options: WuiKeySelectOption;
+ id?: string;
+ hint?: string;
+ is_disabled?: boolean;
+ onChangeHandler?: (values: string[]) => void;
+}
+export declare class WuiInputCheckboxes {
+ opts: WuiInputCheckboxesOpts;
+ el: HTMLElement;
+ private el_label;
+ private el_fieldset;
+ private el_hint;
+ private el_hint_toggler;
+ private values;
+ constructor(opts: WuiInputCheckboxesOpts);
+ private generateLabel;
+ private generateInput;
+ private generateHintToggler;
+ private generateHint;
+ private onClickHintToggler;
+ private onClickCheckbox;
+}