nativescript-cfalert-dialog
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -34,4 +34,6 @@ "use strict"; | ||
CFAlertDialog.prototype.show = function (options) { | ||
if (options.simpleList || options.singleChoiceList || options.multiChoiceList) { | ||
alert('Lists are not available on iOS.'); | ||
if (options.simpleList || | ||
options.singleChoiceList || | ||
options.multiChoiceList) { | ||
alert("Lists are not available on iOS."); | ||
return; | ||
@@ -42,5 +44,5 @@ } | ||
if (!options.title) | ||
options.title = 'Hello world!'; | ||
options.title = "Hello world!"; | ||
if (!options.titleColor) { | ||
options.titleColor = new color_1.Color('black').ios; | ||
options.titleColor = new color_1.Color("black").ios; | ||
} | ||
@@ -52,4 +54,4 @@ else { | ||
options.messageColor = new color_1.Color(options.messageColor).ios; | ||
if (!options.textAlignment) | ||
options.textAlignment = CFAlertGravity.CENTER_HORIZONTAL; | ||
if (typeof options.textAlignment === undefined) | ||
options.textAlignment = CFAlertGravity.START; | ||
var viewController = frame.topmost().currentPage.ios; | ||
@@ -61,6 +63,8 @@ var alertController = CFAlertViewController.alloc().initWithTitleTitleColorMessageMessageColorTextAlignmentPreferredStyleHeaderViewFooterViewDidDismissAlertHandler(options.title, options.titleColor, options.message, options.messageColor, options.textAlignment, options.dialogStyle, options.headerView, options.footerView, function () { | ||
if (options.backgroundBlur) { | ||
alertController.backgroundStyle = CFAlertControllerBackgroundStyle.Blur; | ||
alertController.backgroundStyle = | ||
CFAlertControllerBackgroundStyle.Blur; | ||
} | ||
else { | ||
alertController.backgroundStyle = CFAlertControllerBackgroundStyle.Plain; | ||
alertController.backgroundStyle = | ||
CFAlertControllerBackgroundStyle.Plain; | ||
} | ||
@@ -67,0 +71,0 @@ if (options.backgroundColor) |
export declare enum CFAlertStyle { | ||
NOTIFICATION = 0, | ||
ALERT = 1, | ||
BOTTOM_SHEET = 2, | ||
BOTTOM_SHEET = 2 | ||
} | ||
@@ -9,3 +9,3 @@ export declare enum CFAlertActionStyle { | ||
NEGATIVE = 1, | ||
POSITIVE = 2, | ||
POSITIVE = 2 | ||
} | ||
@@ -16,3 +16,3 @@ export declare enum CFAlertActionAlignment { | ||
CENTER = 2, | ||
JUSTIFIED = 3, | ||
JUSTIFIED = 3 | ||
} | ||
@@ -28,3 +28,3 @@ export enum CFAlertGravity { | ||
title: string; | ||
titleColor?: string, | ||
titleColor?: string; | ||
message?: string; | ||
@@ -34,30 +34,32 @@ messageColor?: string; | ||
textAlignment?: CFAlertGravity; | ||
backgroundColor?: string, | ||
backgroundBlur?: boolean, | ||
cancellable?: boolean, | ||
headerView?: any, // nativeView | ||
footerView?: any, // nativeView | ||
onDismiss?: Function, // calback for dismiss | ||
buttons?: [{ | ||
text: string, // title | ||
buttonStyle: CFAlertActionStyle, | ||
buttonAlignment?: CFAlertActionAlignment, | ||
textColor?: string, | ||
backgroundColor?: string, | ||
onClick: Function | ||
}], | ||
backgroundColor?: string; | ||
backgroundBlur?: boolean; | ||
cancellable?: boolean; | ||
headerView?: any; // nativeView | ||
footerView?: any; // nativeView | ||
onDismiss?: Function; // calback for dismiss | ||
buttons?: [ | ||
{ | ||
text: string; // title | ||
buttonStyle: CFAlertActionStyle; | ||
buttonAlignment?: CFAlertActionAlignment; | ||
textColor?: string; | ||
backgroundColor?: string; | ||
onClick: Function; | ||
} | ||
]; | ||
simpleList?: { | ||
items: [string], | ||
onClick: Function | ||
}, | ||
items: [string]; | ||
onClick: Function; | ||
}; | ||
singleChoiceList?: { | ||
items: [string], | ||
selectedItem: number, | ||
onClick: Function | ||
}, | ||
items: [string]; | ||
selectedItem: number; | ||
onClick: Function; | ||
}; | ||
multiChoiceList?: { | ||
items: [string], | ||
selectedItems: [boolean], | ||
onClick: Function | ||
} | ||
items: [string]; | ||
selectedItems: [boolean]; | ||
onClick: Function; | ||
}; | ||
} | ||
@@ -64,0 +66,0 @@ export declare class CFAlertDialog { |
{ | ||
"name": "nativescript-cfalert-dialog", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "CFAlert Dialog wrapper for NativeScript", | ||
@@ -5,0 +5,0 @@ "main": "cfalert-dialog", |
@@ -25,2 +25,6 @@ # nativescript-cfalert-dialog [![npm](https://img.shields.io/npm/dt/express.svg)](https://www.npmjs.com/package/nativescript-cfalert-dialog) | ||
## Configuration | ||
no configuration step involved | ||
## Usage | ||
@@ -27,0 +31,0 @@ |
106
34226
12
413