New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nativescript-cfalert-dialog

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nativescript-cfalert-dialog

CFAlert Dialog wrapper for NativeScript

  • 1.0.16
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
decreased by-74.47%
Maintainers
2
Weekly downloads
 
Created
Source

nativescript-cfalert-dialog npm

Twitter URL Twitter URL

NPM

This plugin is a wrapper around CFAlertDialog for Android and CFAlertViewController.

Screenshots

Android

iOS

Installation

tns plugin add nativescript-cfalert-dialog

Configuration

no configuration step involved

Usage

NativeScript Core with { TypeScript } (works on Core, Angular and Vue as well)


import { CFAlertDialog,
         DialogOptions,
         CFAlertGravity,
         CFAlertActionAlignment,
         CFAlertActionStyle,
         CFAlertStyle } from 'nativescript-cfalert-dialog';

let cfalertDialog = new CFAlertDialog();

let options: DialogOptions = {
      // Options go here
      dialogStyle: CFAlertStyle.ALERT,
      title: "This is cool!",
    }

cfalertDialog.show(options); // That's about it ;)

API

show(options): Promise<string>;

Shows the CFAlert Dialog based on the options provided. It returns a promise which can either resolve with a button title (if button was clicked), or it can resolve empty (undefined).

dismiss(animate:boolean): void;

Dismiss the CFAlert Dialog (animate option effective on iOS only)

Options format

// Everything that has '?' is optional
export interface DialogOptions {
    dialogStyle: CFAlertStyle;
    title: string;
    titleColor?: string,
    message?: string;
    messageColor?: string;
    textColor?: string;
    textAlignment?: CFAlertGravity;
    backgroundColor?: string,
    backgroundBlur?: string, // iOS only
    cancellable?: boolean,
    headerView?: any, // nativeView
    footerView?: any, // nativeView
    onDismiss?: Function, // calback for dismiss, function (dialog)
    buttons?: [{
        text: string, // title
        buttonStyle: CFAlertActionStyle,
        buttonAlignment?: CFAlertActionAlignment,
        textColor?: string,
        backgroundColor?: string,
        onClick: Function // function (buttonName)
    }],    
    simpleList?: { // android only
        items: [string],
        onClick: Function // function(dialogInterface, index)
    },
    singleChoiceList?: { // android only
        items: [string],
        selectedItem: number,
        onClick: Function // function(dialogInterface, index)
    },
    multiChoiceList?: { // android only
        items: [string],
        selectedItems: [boolean], // should have same number of elements as 'items'
        onClick: Function // function (dialogInterface, index, b)
    }
}

License

Apache License Version 2.0, January 2004

Keywords

FAQs

Package last updated on 07 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc