-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
928 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"printWidth": 80, | ||
"semi": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export function bubbles(event) { | ||
return event.bubbles | ||
} | ||
|
||
export function cancelable(event) { | ||
return event.cancelable | ||
} | ||
|
||
export function currentTarget(event) { | ||
return event.currentTarget | ||
} | ||
|
||
export function defaultPrevented(event) { | ||
return event.defaultPrevented | ||
} | ||
|
||
export function eventPhase(event) { | ||
return event.eventPhase | ||
} | ||
|
||
export function isTrusted(event) { | ||
return event.isTrusted | ||
} | ||
|
||
export function target(event) { | ||
return event.target | ||
} | ||
|
||
export function timeStamp(event) { | ||
return event.timeStamp | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,32 @@ | ||
import gleam/dynamic | ||
import react/internals/attribute.{Attribute} | ||
|
||
pub type Event | ||
|
||
@external(javascript, "../events.ffi.mjs", "bubbles") | ||
pub fn bubbles(event: Event) -> Bool | ||
|
||
@external(javascript, "../events.ffi.mjs", "cancelable") | ||
pub fn cancelable(event: Event) -> Bool | ||
|
||
@external(javascript, "../events.ffi.mjs", "currentTarget") | ||
pub fn current_target(event: Event) -> Bool | ||
|
||
@external(javascript, "../events.ffi.mjs", "defaultPrevented") | ||
pub fn default_prevented(event: Event) -> Bool | ||
|
||
@external(javascript, "../events.ffi.mjs", "eventPhase") | ||
pub fn event_phase(event: Event) -> Bool | ||
|
||
@external(javascript, "../events.ffi.mjs", "isTrusted") | ||
pub fn is_trusted(event: Event) -> Bool | ||
|
||
@external(javascript, "../events.ffi.mjs", "target") | ||
pub fn target(event: Event) -> Bool | ||
|
||
@external(javascript, "../events.ffi.mjs", "timeStamp") | ||
pub fn time_stamp(event: Event) -> Bool | ||
|
||
pub fn on_click(handler: fn() -> Nil) { | ||
Attribute("onClick", dynamic.from(handler)) | ||
} |
Oops, something went wrong.