├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── autocomplete.android.d.ts ├── autocomplete.android.ts ├── autocomplete.ios.d.ts ├── autocomplete.ios.ts ├── demo ├── app │ ├── App_Resources │ │ ├── Android │ │ │ ├── AndroidManifest.xml │ │ │ ├── app.gradle │ │ │ ├── drawable-hdpi │ │ │ │ └── icon.png │ │ │ ├── drawable-ldpi │ │ │ │ └── icon.png │ │ │ ├── drawable-mdpi │ │ │ │ └── icon.png │ │ │ └── drawable-nodpi │ │ │ │ └── splashscreen.9.png │ │ └── iOS │ │ │ ├── Default-568h@2x.png │ │ │ ├── Default-667h@2x.png │ │ │ ├── Default-736h@3x.png │ │ │ ├── Default-Landscape-568h@2x.png │ │ │ ├── Default-Landscape-667h@2x.png │ │ │ ├── Default-Landscape.png │ │ │ ├── Default-Landscape@2x.png │ │ │ ├── Default-Landscape@3x.png │ │ │ ├── Default-Portrait.png │ │ │ ├── Default-Portrait@2x.png │ │ │ ├── Default.png │ │ │ ├── Default@2x.png │ │ │ ├── Icon-Small-50.png │ │ │ ├── Icon-Small-50@2x.png │ │ │ ├── Icon-Small.png │ │ │ ├── Icon-Small@2x.png │ │ │ ├── Info.plist │ │ │ ├── icon-40.png │ │ │ ├── icon-40@2x.png │ │ │ ├── icon-60.png │ │ │ ├── icon-60@2x.png │ │ │ ├── icon-72.png │ │ │ ├── icon-72@2x.png │ │ │ ├── icon-76.png │ │ │ ├── icon-76@2x.png │ │ │ ├── icon.png │ │ │ └── icon@2x.png │ ├── app.css │ ├── app.ts │ ├── main-page.ts │ ├── main-page.xml │ ├── main-view-model.ts │ └── package.json ├── package.json └── tsconfig.json ├── index.d.ts ├── package.json ├── screenshots └── autocomplete.gif └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | *.js.map 3 | *.log 4 | demo/app/*.js 5 | demo/*.d.ts 6 | demo/lib 7 | demo/platforms 8 | demo/node_modules 9 | node_modules -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | demo/ 2 | *.png 3 | *.log 4 | *.map 5 | *.ts 6 | !.d.ts 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | nativescript-autocomplete 4 | Copyright (c) 2016, Osei Fortune 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Autocomplete for NativeScript 2 | 3 | ##Install 4 | ``` 5 | npm install nativescript-autocomplete 6 | ``` 7 | 8 | ##Usage 9 | 10 | IMPORTANT: Make sure you include `xmlns:ac="nativescript-autocomplete"` on the Page element 11 | 12 | e.g 13 | 14 | ``` 15 | item:Array = ['1','2','3','4'] 16 | ``` 17 | ``` 18 | itemTapped(args){ 19 | const eventName = args.eventName; 20 | const data = args.data; 21 | const view = args.view; 22 | const index = args.index; 23 | const object = args.object; 24 | } 25 | ``` 26 | ```xml 27 | 28 | ``` 29 | 30 | 31 | #ScreenShots 32 | Android | 33 | --------| 34 | ![Android](screenshots/autocomplete.gif?raw=true) -------------------------------------------------------------------------------- /autocomplete.android.d.ts: -------------------------------------------------------------------------------- 1 | import * as view from 'ui/core/view'; 2 | export declare class AutoComplete extends view.View { 3 | private _android; 4 | private _items; 5 | private _textColor; 6 | private _threshold; 7 | static itemTapEvent: string; 8 | static onClose: string; 9 | constructor(); 10 | android: android.widget.AutoCompleteTextView; 11 | items: Array; 12 | threshold: number; 13 | textColor: string; 14 | _createUI(): void; 15 | itemsUpdate(items: any): void; 16 | showDropDown(): void; 17 | dismissDropDown(): void; 18 | clearListSelection(): void; 19 | setDropDownHorizontalOffset(offset: number): void; 20 | setDropDownVerticalOffset(offset: number): void; 21 | setDropDownWidth(width: number): void; 22 | setListSelection(index: number): void; 23 | } 24 | export interface ItemTap { 25 | eventName: string; 26 | object: view.View; 27 | index: number; 28 | view: android.widget.AutoCompleteTextView; 29 | data: string; 30 | } 31 | -------------------------------------------------------------------------------- /autocomplete.android.ts: -------------------------------------------------------------------------------- 1 | import * as view from 'ui/core/view'; 2 | import {TextView} from 'ui/text-view' 3 | import app = require('application'); 4 | import {Color} from 'color'; 5 | declare var android: any; 6 | declare var Array: any; 7 | export class AutoComplete extends view.View { 8 | private _android: android.widget.AutoCompleteTextView; 9 | private _items: Array; 10 | private _textColor: string; 11 | private _threshold: number; 12 | public static itemTapEvent = "itemTap"; 13 | public static onClose = "onClose"; 14 | constructor() { 15 | super(); 16 | } 17 | get android(): android.widget.AutoCompleteTextView { 18 | return this._android; 19 | } 20 | set items(value: Array) { 21 | this._items = value; 22 | if (value) { 23 | this.itemsUpdate(value); 24 | } 25 | } 26 | get items() { 27 | return this._items; 28 | } 29 | set threshold(value: number) { 30 | this._threshold = value; 31 | } 32 | get threshold() { 33 | return this._threshold; 34 | } 35 | set textColor(value) { 36 | this._textColor = value; 37 | } 38 | get textColor() { 39 | return this._textColor; 40 | } 41 | 42 | _createUI() { 43 | this._android = new android.widget.AutoCompleteTextView(app.android.context); 44 | if (!this.threshold) { 45 | this._android.setThreshold(1); 46 | } else { 47 | this._android.setThreshold(this.threshold); 48 | } 49 | 50 | if (!this.textColor) { 51 | this._android.setTextColor(new Color('black').android); 52 | } else { 53 | this._android.setTextColor(new Color(this.textColor).android); 54 | } 55 | 56 | const that = new WeakRef(this); 57 | this._android.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener({ 58 | onItemClick(parent: any, view: android.widget.TextView, index: number, id: number) { 59 | let owner = that.get(); 60 | if (owner) { 61 | owner.notify({ eventName: AutoComplete.itemTapEvent, object: owner, index: index, view: view, data: view.getText() }); 62 | } 63 | 64 | } 65 | })); 66 | 67 | this._android.setOnDismissListener(new android.widget.AutoCompleteTextView.OnDismissListener({ 68 | onDismiss() { 69 | let owner = that.get(); 70 | if (owner) { 71 | owner.notify({ eventName: AutoComplete.onClose, object: owner }); 72 | } 73 | } 74 | })); 75 | 76 | 77 | } 78 | itemsUpdate(items) { 79 | const arr = Array.create(java.lang.String, this.items.length); 80 | this.items.forEach((item, index) => { 81 | arr[index] = item; 82 | }); 83 | let ad = new android.widget.ArrayAdapter(app.android.context, android.R.layout.simple_list_item_1, arr); 84 | this._android.setAdapter(ad); 85 | } 86 | showDropDown() { 87 | this._android.showDropDown(); 88 | } 89 | dismissDropDown() { 90 | this._android.dismissDropDown(); 91 | } 92 | clearListSelection() { 93 | this._android.clearListSelection(); 94 | } 95 | setDropDownHorizontalOffset(offset: number) { 96 | this._android.setDropDownHorizontalOffset(offset); 97 | } 98 | setDropDownVerticalOffset(offset: number) { 99 | this._android.setDropDownVerticalOffset(offset); 100 | } 101 | setDropDownWidth(width: number) { 102 | this._android.setDropDownWidth(width); 103 | } 104 | setListSelection(index: number) { 105 | this._android.setListSelection(index); 106 | } 107 | } 108 | 109 | export interface ItemTap{ 110 | eventName:string 111 | object: view.View 112 | index: number 113 | view: android.widget.AutoCompleteTextView 114 | data: string 115 | } -------------------------------------------------------------------------------- /autocomplete.ios.d.ts: -------------------------------------------------------------------------------- 1 | export declare class AutoComplete { 2 | } 3 | -------------------------------------------------------------------------------- /autocomplete.ios.ts: -------------------------------------------------------------------------------- 1 | export class AutoComplete{} -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/app.gradle: -------------------------------------------------------------------------------- 1 | // Add your native dependencies here: 2 | 3 | // Uncomment to add recyclerview-v7 dependency 4 | //dependencies { 5 | // compile 'com.android.support:recyclerview-v7:+' 6 | //} -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/Android/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/Android/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/Android/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-nodpi/splashscreen.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/Android/drawable-nodpi/splashscreen.9.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/Default-568h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/Default-667h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/Default-736h@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-Landscape-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/Default-Landscape-568h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-Landscape-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/Default-Landscape-667h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/Default-Landscape.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-Landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/Default-Landscape@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-Landscape@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/Default-Landscape@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/Default-Portrait.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/Default-Portrait@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/Default.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/Default@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Icon-Small-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/Icon-Small-50.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Icon-Small-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/Icon-Small-50@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/Icon-Small.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/Icon-Small@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/icon-40.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/icon-40@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/icon-60.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/icon-60@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/icon-72.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/icon-72@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/icon-76.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/icon-76@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/demo/app/App_Resources/iOS/icon@2x.png -------------------------------------------------------------------------------- /demo/app/app.css: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /demo/app/app.ts: -------------------------------------------------------------------------------- 1 | import * as application from 'application'; 2 | application.start({ moduleName: 'main-page' }); 3 | -------------------------------------------------------------------------------- /demo/app/main-page.ts: -------------------------------------------------------------------------------- 1 | import * as observable from 'data/observable'; 2 | import * as pages from 'ui/page'; 3 | import {HelloWorldModel} from './main-view-model'; 4 | // Event handler for Page "loaded" event attached in main-page.xml 5 | export function pageLoaded(args: observable.EventData) { 6 | // Get the event sender 7 | var page = args.object; 8 | page.bindingContext = new HelloWorldModel(); 9 | } 10 | 11 | export function itemTapped(args){ 12 | console.log(args.data) 13 | } -------------------------------------------------------------------------------- /demo/app/main-page.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /demo/app/main-view-model.ts: -------------------------------------------------------------------------------- 1 | import {Observable} from 'data/observable'; 2 | 3 | export class HelloWorldModel extends Observable { 4 | constructor() { 5 | super(); 6 | this.set('list',['home','work','walker','witch','which','school','women','nativescript','none','brad','stuff','holland']) 7 | } 8 | } -------------------------------------------------------------------------------- /demo/app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tns-template-hello-world-ts", 3 | "main": "app.js", 4 | "version": "1.6.0", 5 | "author": { 6 | "name": "Telerik", 7 | "email": "support@telerik.com" 8 | }, 9 | "description": "Nativescript hello-world-ts project template", 10 | "license": "Apache-2.0", 11 | "keywords": [ 12 | "telerik", 13 | "mobile", 14 | "nativescript", 15 | "{N}", 16 | "tns", 17 | "appbuilder", 18 | "template" 19 | ], 20 | "repository": { 21 | "type": "git", 22 | "url": "git+ssh://git@github.com/NativeScript/template-hello-world-ts.git" 23 | }, 24 | "bugs": { 25 | "url": "https://github.com/NativeScript/template-hello-world-ts/issues" 26 | }, 27 | "homepage": "https://github.com/NativeScript/template-hello-world-ts", 28 | "android": { 29 | "v8Flags": "--expose_gc" 30 | }, 31 | "devDependencies": { 32 | "nativescript-dev-typescript": "^0.3.0" 33 | }, 34 | "_id": "tns-template-hello-world-ts@1.6.0", 35 | "_shasum": "a567c2b9a56024818c06596dab9629d155c5b8a8", 36 | "_resolved": "https://registry.npmjs.org/tns-template-hello-world-ts/-/tns-template-hello-world-ts-1.6.0.tgz", 37 | "_from": "tns-template-hello-world-ts@latest", 38 | "scripts": {}, 39 | "_npmVersion": "2.14.7", 40 | "_nodeVersion": "4.2.2", 41 | "_npmUser": { 42 | "name": "enchev", 43 | "email": "vladimir.enchev@gmail.com" 44 | }, 45 | "dist": { 46 | "shasum": "a567c2b9a56024818c06596dab9629d155c5b8a8", 47 | "tarball": "http://registry.npmjs.org/tns-template-hello-world-ts/-/tns-template-hello-world-ts-1.6.0.tgz" 48 | }, 49 | "maintainers": [ 50 | { 51 | "name": "enchev", 52 | "email": "vladimir.enchev@gmail.com" 53 | }, 54 | { 55 | "name": "erjangavalji", 56 | "email": "erjan.gavalji@gmail.com" 57 | }, 58 | { 59 | "name": "fatme", 60 | "email": "hfatme@gmail.com" 61 | }, 62 | { 63 | "name": "hdeshev", 64 | "email": "hristo@deshev.com" 65 | }, 66 | { 67 | "name": "kerezov", 68 | "email": "d.kerezov@gmail.com" 69 | }, 70 | { 71 | "name": "ligaz", 72 | "email": "stefan.dobrev@gmail.com" 73 | }, 74 | { 75 | "name": "nsndeck", 76 | "email": "nedyalko.nikolov@telerik.com" 77 | }, 78 | { 79 | "name": "rosen-vladimirov", 80 | "email": "rosen.vladimirov.91@gmail.com" 81 | }, 82 | { 83 | "name": "sdobrev", 84 | "email": "stefan.dobrev@gmail.com" 85 | }, 86 | { 87 | "name": "tailsu", 88 | "email": "tailsu@gmail.com" 89 | }, 90 | { 91 | "name": "teobugslayer", 92 | "email": "teobugslayer@gmail.com" 93 | }, 94 | { 95 | "name": "valio.stoychev", 96 | "email": "valio.stoychev@gmail.com" 97 | } 98 | ], 99 | "_npmOperationalInternal": { 100 | "host": "packages-5-east.internal.npmjs.com", 101 | "tmp": "tmp/tns-template-hello-world-ts-1.6.0.tgz_1455717516189_0.6427943941671401" 102 | }, 103 | "directories": {}, 104 | "readme": "ERROR: No README data found!" 105 | } 106 | -------------------------------------------------------------------------------- /demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "nativescript": { 3 | "id": "org.nativescript.demo", 4 | "tns-ios": { 5 | "version": "2.1.1" 6 | }, 7 | "tns-android": { 8 | "version": "2.1.1" 9 | } 10 | }, 11 | "dependencies": { 12 | "nativescript-autocomplete": "file:..", 13 | "tns-core-modules": "^2.0.0" 14 | }, 15 | "devDependencies": { 16 | "babel-traverse": "6.7.6", 17 | "babel-types": "6.7.7", 18 | "babylon": "6.7.0", 19 | "filewalker": "0.1.2", 20 | "lazy": "1.0.11", 21 | "nativescript-dev-typescript": "^0.3.2", 22 | "typescript": "^1.8.10" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /demo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es5", 5 | "sourceMap": true, 6 | "experimentalDecorators": true, 7 | "noEmitHelpers": true 8 | }, 9 | "exclude": [ 10 | "node_modules", 11 | "platforms" 12 | ] 13 | } -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './autocomplete.android'; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nativescript-autocomplete", 3 | "version": "1.0.0", 4 | "description": "An editable text view that shows completion suggestions automatically while the user is typing.", 5 | "main": "autocomplete.js", 6 | "nativescript": { 7 | "platforms": { 8 | "android": "2.1.1" 9 | } 10 | }, 11 | "scripts": { 12 | "build": "tsc", 13 | "demo.ios": "npm run preparedemo && cd demo && tns emulate ios", 14 | "demo.android": "npm run preparedemo && cd demo && tns run android", 15 | "preparedemo": "npm run build && cd demo && tns plugin remove nativescript-autocomplete && tns plugin add .. && tns install", 16 | "setup": "cd demo && npm install && cd .. && npm run build && cd demo && tns plugin add .. && cd .." 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "https://github.com/triniwiz/nativescript-autocomplete.git" 21 | }, 22 | "keywords": [ 23 | "NativeScript", 24 | "JavaScript", 25 | "Android", 26 | "iOS" 27 | ], 28 | "author": { 29 | "name": "Osei Fortune", 30 | "email": "fortune.osei@yahoo.com" 31 | }, 32 | "bugs": { 33 | "url": "https://github.com/triniwiz/nativescript-autocomplete/issues" 34 | }, 35 | "license": { 36 | "type": "MIT", 37 | "url": "https://github.com/triniwiz/nativescript-autocomplete/blob/master/LICENSE" 38 | }, 39 | "homepage": "https://github.com/triniwiz/nativescript-autocomplete", 40 | "readmeFilename": "README.md", 41 | "devDependencies": { 42 | "tns-platform-declarations": "^2.0.0", 43 | "typescript": "^1.8.10" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /screenshots/autocomplete.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/nativescript-autocomplete/8967fa9e7c3edf63fd403fba05f05832dbf72b0e/screenshots/autocomplete.gif -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "removeComments": true, 6 | "experimentalDecorators": true, 7 | "noEmitHelpers": true, 8 | "declaration": true 9 | }, 10 | "files": [ 11 | "demo/node_modules/tns-core-modules/tns-core-modules.d.ts", 12 | "node_modules/tns-platform-declarations/android17.d.ts", 13 | "node_modules/tns-platform-declarations/ios.d.ts", 14 | "node_modules/tns-platform-declarations/org.nativescript.widgets.d.ts", 15 | "autocomplete.android.ts", 16 | "autocomplete.ios.ts" 17 | ], 18 | "compileOnSave": false 19 | } --------------------------------------------------------------------------------