Try Install Learn Blog API Packages GitHub
Pages
mint-ui

Search
Basic information
Entities
Versions
Dependencies
mint-color 0.5.0 <= v < 1.0.0

Ui.ImageCrop

A simple image cropping component.

States

status
=
Ui.ImageCrop.Status::Idle

The status.

Properties

embedded
:
Bool
=
false

Whether or not to embed the panel (removes border and padding).

onChange
:
Function(Ui.ImageCrop.Value, Promise(Never, Void))
=
Promise.never1

The change event handler.

size
:
Ui.Size
=
Ui.Size::Inherit

The size of the component.

value
:
Ui.ImageCrop.Value
=
{ source = "", height = 0.5, width = 0.5, x = 0.25, y = 0.25 }

The value (crop data).

Functions

calculateAxis
(
direction
:
Ui.ImageCrop.Direction
startPosition
:
Number
startSize
:
Number
distance
:
Number
)

Calculates the next position and size based on a direction for an axis.

handleKeyDown
(
event
:
Html.Event
)

Handles the keydown event.

moves
(
event
:
Html.Event
)
:
Promise(Never, Void)

Handles the move event.

Renders the component.

startDrag
(
directions
:
Tuple(Ui.ImageCrop.Direction, Ui.ImageCrop.Direction)
event
:
Html.Event
)

Starts the drag.

ups
(
event
:
Html.Event
)
:
Promise(Never, Void)

Handles the up event.