mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
refactor(): added default items interface (#1725)
This commit is contained in:
parent
cdb99a74cc
commit
12a83831c8
@ -5,6 +5,11 @@ export interface WheelSelectorItem {
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface DefaultItem {
|
||||
index: number;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface WheelSelectorOptions {
|
||||
/**
|
||||
* The title of the selector's input box
|
||||
@ -17,9 +22,9 @@ export interface WheelSelectorOptions {
|
||||
items: Array<Array<WheelSelectorItem>>;
|
||||
|
||||
/**
|
||||
* Which items to display by default, example ["2","Apple"] (if items.length is 2 for instance)
|
||||
* Which items to display by default.
|
||||
*/
|
||||
defaultItems?: Array<WheelSelectorItem>;
|
||||
defaultItems?: Array<DefaultItem>;
|
||||
|
||||
/**
|
||||
* The 'ok' button text
|
||||
@ -127,9 +132,9 @@ export interface WheelSelectorData {
|
||||
* positiveButtonText: "Ok",
|
||||
* negativeButtonText: "Nope",
|
||||
* defaultItems: [
|
||||
* this.jsonData.numbers[2], // '3'
|
||||
* this.jsonData.fruits[3] // 'Banana'
|
||||
* ]
|
||||
* {index:0, value: this.jsonData.numbers[2].description},
|
||||
* {index: 1, value: this.jsonData.fruits[3].description}
|
||||
* ]
|
||||
* }).then(
|
||||
* result => {
|
||||
* console.log(result[0].description + ' ' + result[1].description);
|
||||
@ -150,8 +155,8 @@ export interface WheelSelectorData {
|
||||
* ],
|
||||
* displayKey: 'name',
|
||||
* defaultItems: [
|
||||
* this.jsonData.firstNames[2],
|
||||
* this.jsonData.lastNames[3]
|
||||
* {index:0, value: this.jsonData.firstNames[2].name},
|
||||
* {index: 0, value: this.jsonData.lastNames[3].name}
|
||||
* ]
|
||||
* }).then(
|
||||
* result => {
|
||||
|
Loading…
Reference in New Issue
Block a user