mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-05-14 22:54:06 +08:00
refactor(wheel-selector): fixes & enhancements
This commit is contained in:
parent
235f51a351
commit
af66a0dbec
@ -1,6 +1,10 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
export interface WheelSelectorItem {
|
||||||
|
description: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface WheelSelectorOptions {
|
export interface WheelSelectorOptions {
|
||||||
/**
|
/**
|
||||||
* The title of the selector's input box
|
* The title of the selector's input box
|
||||||
@ -9,16 +13,13 @@ export interface WheelSelectorOptions {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The items to display (array of items).
|
* The items to display (array of items).
|
||||||
* Example, 2 wheels:
|
|
||||||
* [{description: "1", description: "2", description: "3"},
|
|
||||||
* {description: "Apple", description: "Pear", description: "Banana"}]
|
|
||||||
*/
|
*/
|
||||||
items: {};
|
items: WheelSelectorItem[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Which items to display by default, example ["2","Apple"] (if items.length is 2 for instance)
|
* Which items to display by default, example ["2","Apple"] (if items.length is 2 for instance)
|
||||||
*/
|
*/
|
||||||
defaultItems?: any;
|
defaultItems?: WheelSelectorItem[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The 'ok' button text
|
* The 'ok' button text
|
||||||
@ -53,17 +54,17 @@ export interface WheelSelectorOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface WheelSelectorData {
|
export interface WheelSelectorData {
|
||||||
|
|
||||||
data: any;
|
data: any;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @beta
|
||||||
* @name WheelSelector Plugin
|
* @name WheelSelector Plugin
|
||||||
* @description Native wheel selector for Cordova (Android/iOS).
|
* @description Native wheel selector for Cordova (Android/iOS).
|
||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* ```
|
* ```
|
||||||
* import { WheelSelector } from 'ionic-native';
|
* import { WheelSelector } from '@ionic-native/wheel-selector';
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* constructor(private selector: WheelSelector) { }
|
* constructor(private selector: WheelSelector) { }
|
||||||
@ -123,4 +124,13 @@ export class WheelSelector extends IonicNativePlugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide the selector
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
@Cordova({
|
||||||
|
platforms: ['iOS']
|
||||||
|
})
|
||||||
|
hideSelector(): Promise<void> { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user