mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-22 01:19:36 +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;
|
description?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface DefaultItem {
|
||||||
|
index: number;
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface WheelSelectorOptions {
|
export interface WheelSelectorOptions {
|
||||||
/**
|
/**
|
||||||
* The title of the selector's input box
|
* The title of the selector's input box
|
||||||
@ -17,9 +22,9 @@ export interface WheelSelectorOptions {
|
|||||||
items: Array<Array<WheelSelectorItem>>;
|
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
|
* The 'ok' button text
|
||||||
@ -127,9 +132,9 @@ export interface WheelSelectorData {
|
|||||||
* positiveButtonText: "Ok",
|
* positiveButtonText: "Ok",
|
||||||
* negativeButtonText: "Nope",
|
* negativeButtonText: "Nope",
|
||||||
* defaultItems: [
|
* defaultItems: [
|
||||||
* this.jsonData.numbers[2], // '3'
|
* {index:0, value: this.jsonData.numbers[2].description},
|
||||||
* this.jsonData.fruits[3] // 'Banana'
|
* {index: 1, value: this.jsonData.fruits[3].description}
|
||||||
* ]
|
* ]
|
||||||
* }).then(
|
* }).then(
|
||||||
* result => {
|
* result => {
|
||||||
* console.log(result[0].description + ' ' + result[1].description);
|
* console.log(result[0].description + ' ' + result[1].description);
|
||||||
@ -150,8 +155,8 @@ export interface WheelSelectorData {
|
|||||||
* ],
|
* ],
|
||||||
* displayKey: 'name',
|
* displayKey: 'name',
|
||||||
* defaultItems: [
|
* defaultItems: [
|
||||||
* this.jsonData.firstNames[2],
|
* {index:0, value: this.jsonData.firstNames[2].name},
|
||||||
* this.jsonData.lastNames[3]
|
* {index: 0, value: this.jsonData.lastNames[3].name}
|
||||||
* ]
|
* ]
|
||||||
* }).then(
|
* }).then(
|
||||||
* result => {
|
* result => {
|
||||||
|
Loading…
Reference in New Issue
Block a user