Commit ccb3145a authored by Andrea Ascari's avatar Andrea Ascari Committed by zooble

Made callback for isPickerShow optional (#296)

parent 358d080a
......@@ -5,15 +5,15 @@
/**
* Options to create a picker object
*
*
* @interface PickerOptions
*/
interface PickerOptions {
/**
* Items to be passed into the picker
*
*
* Default is an empty array
*
*
* @type {any[]}
* @memberof PickerOptions
*/
......@@ -21,12 +21,12 @@ interface PickerOptions {
/**
* The selected item in the picker
*
*
* Accepts the item in an array
* Example: ['selected']
*
*
* Default is an empty array
*
*
* @type {any[]}
* @memberof PickerOptions
*/
......@@ -34,9 +34,9 @@ interface PickerOptions {
/**
* Title text shown at the top of the picker
*
*
* Default value is 'pls select'
*
*
* @type {string}
* @memberof PickerOptions
*/
......@@ -44,9 +44,9 @@ interface PickerOptions {
/**
* Text for the confirm button
*
*
* Default value is 'confirm'
*
*
* @type {string}
* @memberof PickerOptions
*/
......@@ -54,9 +54,9 @@ interface PickerOptions {
/**
* Text for the cancel button
*
*
* Default value is 'cancel'
*
*
* @type {string}
* @memberof PickerOptions
*/
......@@ -64,12 +64,12 @@ interface PickerOptions {
/**
* The color of the text for the confirm button
*
*
* Accepts rgba values as an array
* [R, G, B, A]
*
*
* Default is [1, 186, 245, 1]
*
*
* @type {number[]}
* @memberof PickerOptions
*/
......@@ -77,12 +77,12 @@ interface PickerOptions {
/**
* The color of the text for the cancel button
*
*
* Accepts rgba values as an array
* [R, G, B, A]
*
*
* Default is [1, 186, 245, 1]
*
*
* @type {number[]}
* @memberof PickerOptions
*/
......@@ -90,12 +90,12 @@ interface PickerOptions {
/**
* The color of the Title text
*
*
* Accepts rgba values as an array
* [R, G, B, A]
*
*
* Default is [20, 20, 20, 1]
*
*
* @type {number[]}
* @memberof PickerOptions
*/
......@@ -103,12 +103,12 @@ interface PickerOptions {
/**
* The background color of the toobar
*
*
* Accepts rgba values as an array
* [R, G, B, A]
*
*
* Default is [232, 232, 232, 1]
*
*
* @type {number[]}
* @memberof PickerOptions
*/
......@@ -116,12 +116,12 @@ interface PickerOptions {
/**
* Background color of the picker
*
*
* Accepts rgba values as an array
* [R, G, B, A]
*
*
* Default is [196, 199, 206, 1]
*
*
* @type {number[]}
* @memberof PickerOptions
*/
......@@ -130,9 +130,9 @@ interface PickerOptions {
/**
* Font size of the items in the toolbar
*
*
* Default is 16
*
*
* @type {number}
* @memberof PickerOptions
*/
......@@ -140,9 +140,9 @@ interface PickerOptions {
/**
* Font size of the items in the picker
*
*
* Default is 16
*
*
* @type {number}
* @memberof PickerOptions
*/
......@@ -150,9 +150,9 @@ interface PickerOptions {
/**
* Row height of the items in the picker
*
*
* Default is 24
*
*
* @type {number}
* @memberof PickerOptions
*/
......@@ -160,12 +160,12 @@ interface PickerOptions {
/**
* Color of the text for the items in the picker
*
*
* Accepts rgba values as an array
* [R, G, B, A]
*
*
* Default is [31, 31, 31, 1]
*
*
* @type {number[]}
* @memberof PickerOptions
*/
......@@ -173,22 +173,22 @@ interface PickerOptions {
/**
* Event fired when user confirms the picker
*
*
* Returns the selected item
*
* @param {any[]} item
*
*
* @param {any[]} item
*
* @memberof PickerOptions
*/
onPickerConfirm?(item: any[]): void
/**
* Event fired when user cancels the picker
*
*
* Returns the selected item
*
* @param {any[]} item
*
*
* @param {any[]} item
*
* @memberof PickerOptions
*/
onPickerCancel?(item: any[]): void
......@@ -196,11 +196,11 @@ interface PickerOptions {
/**
* Event fired when user scrolls over or selects a value in the picker
*
*
* Returns the selected item
*
* @param {any[]} item
*
*
* @param {any[]} item
*
* @memberof PickerOptions
*/
onPickerSelect?(item: any[]): void
......@@ -210,61 +210,61 @@ interface PickerOptions {
export default class Picker {
/**
* Creates a new Picker objects
*
*
* @static
* @param {PickerOptions} options
*
* @param {PickerOptions} options
*
* @memberof Picker
*/
static init(options: PickerOptions): void
/**
* Shows the picker
*
*
* @static
*
*
* @memberof Picker
*/
static show(): void
/**
* Hides the picker
*
*
* @static
*
*
* @memberof Picker
*/
static hide(): void
/**
* Toggles the visibility of the picker
*
*
* @static
*
*
* @memberof Picker
*/
static toggle(): void
/**
* Sets an item in the picker as the selected value
*
*
* Accepts the item in an array
* Example: ['selected']
*
*
* @static
* @param {any[]} item
*
* @param {any[]} item
*
* @memberof Picker
*/
static select(item: any[]): void
/**
* Checks if the picker is showing currently
*
*
* @static
* @returns {boolean}
*
* @returns {boolean}
*
* @memberof Picker
*/
static isPickerShow(): boolean
}
\ No newline at end of file
static isPickerShow(fn?: (err: any, message: any) => void): boolean
}
......@@ -91,7 +91,7 @@ export default {
else if(ios){
returnValue = !err;
}
fn(returnValue);
fn && fn(returnValue);
});
}
};
\ No newline at end of file
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment