|
|
@ -5,11 +5,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
package androidx.compose.web.attributes |
|
|
|
package androidx.compose.web.attributes |
|
|
|
|
|
|
|
|
|
|
|
import org.jetbrains.compose.web.attributes.* |
|
|
|
import org.jetbrains.compose.web.attributes.AttrsBuilder |
|
|
|
import org.jetbrains.compose.web.events.GenericWrappedEvent |
|
|
|
import org.jetbrains.compose.web.attributes.InputType |
|
|
|
import org.jetbrains.compose.web.events.WrappedCheckBoxInputEvent |
|
|
|
import org.jetbrains.compose.web.attributes.Options |
|
|
|
import org.jetbrains.compose.web.events.WrappedRadioInputEvent |
|
|
|
|
|
|
|
import org.jetbrains.compose.web.events.WrappedTextInputEvent |
|
|
|
|
|
|
|
import org.w3c.dom.HTMLElement |
|
|
|
import org.w3c.dom.HTMLElement |
|
|
|
import org.w3c.dom.HTMLInputElement |
|
|
|
import org.w3c.dom.HTMLInputElement |
|
|
|
import org.w3c.dom.events.Event |
|
|
|
import org.w3c.dom.events.Event |
|
|
@ -45,49 +43,4 @@ class InputAttrsBuilder<T>(val inputType: InputType<T>) : AttrsBuilder<HTMLInput |
|
|
|
listener(SyntheticInputEvent(value, it.nativeEvent.target as HTMLInputElement, it.nativeEvent)) |
|
|
|
listener(SyntheticInputEvent(value, it.nativeEvent.target as HTMLInputElement, it.nativeEvent)) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Deprecated( |
|
|
|
|
|
|
|
message = "It's not reliable as it can be applied to any input type.", |
|
|
|
|
|
|
|
replaceWith = ReplaceWith("onInput(options, listener)"), |
|
|
|
|
|
|
|
level = DeprecationLevel.WARNING |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
fun onTextInput(options: Options = Options.DEFAULT, listener: (WrappedTextInputEvent) -> Unit) { |
|
|
|
|
|
|
|
listeners.add(TextInputEventListener(options, listener)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Deprecated( |
|
|
|
|
|
|
|
message = "It's not reliable as it can be applied to any input type.", |
|
|
|
|
|
|
|
replaceWith = ReplaceWith("onInput(options, listener)"), |
|
|
|
|
|
|
|
level = DeprecationLevel.WARNING |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
fun onCheckboxInput( |
|
|
|
|
|
|
|
options: Options = Options.DEFAULT, |
|
|
|
|
|
|
|
listener: (WrappedCheckBoxInputEvent) -> Unit |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
listeners.add(CheckBoxInputEventListener(options, listener)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Deprecated( |
|
|
|
|
|
|
|
message = "It's not reliable as it can be applied to any input type.", |
|
|
|
|
|
|
|
replaceWith = ReplaceWith("onInput(options, listener)"), |
|
|
|
|
|
|
|
level = DeprecationLevel.WARNING |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
fun onRadioInput( |
|
|
|
|
|
|
|
options: Options = Options.DEFAULT, |
|
|
|
|
|
|
|
listener: (WrappedRadioInputEvent) -> Unit |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
listeners.add(RadioInputEventListener(options, listener)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Deprecated( |
|
|
|
|
|
|
|
message = "It's not reliable as it can be applied to any input type.", |
|
|
|
|
|
|
|
replaceWith = ReplaceWith("onInput(options, listener)"), |
|
|
|
|
|
|
|
level = DeprecationLevel.WARNING |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
fun onRangeInput( |
|
|
|
|
|
|
|
options: Options = Options.DEFAULT, |
|
|
|
|
|
|
|
listener: (GenericWrappedEvent<*>) -> Unit |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
listeners.add(WrappedEventListener(INPUT, options, listener)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|