Skip to content

Commit

Permalink
Expose the MDCList component (no wrapper yet).
Browse files Browse the repository at this point in the history
  • Loading branch information
anlumo committed Feb 29, 2020
1 parent c16d23b commit 5f24c46
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ default = [
"card",
"snackbar",
"switch",
"list",
]
button = []
fab = []
Expand All @@ -30,6 +31,7 @@ card = ["stdweb"]
dialog = ["serde", "serde_json", "wasm-bindgen/serde-serialize"]
snackbar = []
switch = []
list = []

[dependencies]
yew = { version = "0.11", default-features = false }
Expand Down
28 changes: 28 additions & 0 deletions src/mdc_sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,31 @@ extern "C" {
#[wasm_bindgen(method, setter, js_name = disabled)]
pub fn set_disabled(this: &MDCSwitch, disabled: bool);
}

#[cfg(feature = "list")]
#[wasm_bindgen(module = "@material/list")]
extern "C" {
#[wasm_bindgen(extends = MDCComponent)]
pub type MDCList;

#[wasm_bindgen(constructor)]
pub fn new(surface: Element) -> MDCList;

#[wasm_bindgen(method, setter = vertical, structural)]
pub fn set_vertical(this: &MDCList, flag: bool);

#[wasm_bindgen(method, getter = listElements, structural)]
pub fn list_elements(this: &MDCList) -> js_sys::Array;

#[wasm_bindgen(method, setter = wrapFocus, structural)]
pub fn set_wrap_focus(this: &MDCList, flag: bool);

#[wasm_bindgen(method, setter = singleSelection, structural)]
pub fn set_single_selection(this: &MDCList, flag: bool);

#[wasm_bindgen(method, getter = selectedIndex, structural)]
pub fn selected_index(this: &MDCList) -> i32;

#[wasm_bindgen(method, setter = selectedIndex, structural)]
pub fn set_selected_index(this: &MDCList, value: i32);
}

0 comments on commit 5f24c46

Please sign in to comment.