fuse-open / fuselibs

Fuselibs is the Uno-libraries that provide the UI framework used in Fuse apps
https://npmjs.com/package/@fuse-open/fuselibs
MIT License
176 stars 72 forks source link

Trigger Action for Native Alerts #1397

Closed ichan-mb closed 3 years ago

ichan-mb commented 3 years ago

This adds trigger action for showing a native alert dialog.

Examples:

<JavaScript>
    module.exports = {
        handler: function(data) {
            if (data.buttonLabel == 'Yes'){
                console.log("yes button clicked")
            }
            if (data.buttonLabel == 'No'){
                console.log("no button clicked")
            }
        }
    };
</JavaScript>
<StackPanel ItemSpacing="10'>
    <Button Text="Display Alert" Alignment="Center">
        <Clicked>
            <ShowAlert Message="Hello world!" OkLabelButton="Yes" Handler="{handler}"/>
        </Clicked>
    </Button>
    <Button Text="Display Confirm" Alignment="Center">
        <Clicked>
            <ShowConfirm Message="Are you sure want to logout?" OkLabelButton="Yes" CancelLabelButton="No" Handler="{handler}"/>
        </Clicked>
    </Button>
</StackPanel>

This PR contains:

mortend commented 3 years ago