use js_sys::Array;
use std::fmt::{Debug, Formatter};
use wasm_bindgen::JsCast;
use web_sys::{DataTransfer, Event, EventTarget, InputEvent, Node, Window};
#[derive(Clone, PartialEq, Eq)]
pub struct OnInput {
inner: InputEvent,
}
impl Debug for OnInput {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.write_str("OnInput")
}
}
impl From<Event> for OnInput {
fn from(e: Event) -> Self {
Self { inner: e.unchecked_into() }
}
}
impl OnInput {
#[inline]
pub fn is_composing(&self) -> bool {
self.inner.is_composing()
}
#[inline]
pub fn input_type(&self) -> String {
self.inner.input_type()
}
#[inline]
pub fn data(&self) -> Option<String> {
self.inner.data()
}
#[inline]
pub fn data_transfer(&self) -> Option<DataTransfer> {
self.inner.data_transfer()
}
#[inline]
pub fn get_target_ranges(&self) -> ::js_sys::Array {
self.inner.get_target_ranges()
}
}
impl OnInput {
#[inline]
pub fn view(&self) -> Option<Window> {
self.inner.view()
}
#[inline]
pub fn detail(&self) -> i32 {
self.inner.detail()
}
#[inline]
pub fn layer_x(&self) -> i32 {
self.inner.layer_x()
}
#[inline]
pub fn layer_y(&self) -> i32 {
self.inner.layer_y()
}
#[inline]
pub fn page_x(&self) -> i32 {
self.inner.page_x()
}
#[inline]
pub fn page_y(&self) -> i32 {
self.inner.page_y()
}
#[inline]
pub fn which(&self) -> u32 {
self.inner.which()
}
#[inline]
pub fn range_parent(&self) -> Option<Node> {
self.inner.range_parent()
}
#[inline]
pub fn range_offset(&self) -> i32 {
self.inner.range_offset()
}
}
impl OnInput {
#[inline]
pub fn r#type(&self) -> String {
self.inner.type_()
}
pub fn target(&self) -> Option<EventTarget> {
self.inner.target()
}
pub fn current_target(&self) -> Option<EventTarget> {
self.inner.current_target()
}
#[inline]
pub fn event_phase(&self) -> u16 {
self.inner.event_phase()
}
#[inline]
pub fn bubbles(&self) -> bool {
self.inner.bubbles()
}
#[inline]
pub fn cancelable(&self) -> bool {
self.inner.cancelable()
}
#[inline]
pub fn default_prevented(&self) -> bool {
self.inner.default_prevented()
}
#[inline]
pub fn composed(&self) -> bool {
self.inner.composed()
}
#[inline]
pub fn is_trusted(&self) -> bool {
self.inner.is_trusted()
}
#[inline]
pub fn time_stamp(&self) -> f64 {
self.inner.time_stamp()
}
#[inline]
pub fn cancel_bubble(&self) -> bool {
self.inner.cancel_bubble()
}
#[inline]
pub fn set_cancel_bubble(&self, value: bool) {
self.inner.set_cancel_bubble(value)
}
#[inline]
pub fn composed_path(&self) -> Array {
self.inner.composed_path()
}
#[inline]
pub fn prevent_default(&self) {
self.inner.prevent_default()
}
#[inline]
pub fn stop_immediate_propagation(&self) {
self.inner.stop_immediate_propagation()
}
#[inline]
pub fn stop_propagation(&self) {
self.inner.stop_propagation()
}
}