npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nativescript-picker

v2.1.2

Published

A NativeScript plugin that provides a custom TextField which lets you pick a value from a list opened in a modal popup.

Downloads

34

Readme

nativescript-picker

Build Status npm npm Dependency status peerDependencies Status

A NativeScript plugin that provides ui element for picking an object/value from a list opened in a modal popup.

Screenshots

Installation

tns plugin add nativescript-picker

Configuration

No additional configuration required!

Usage

To use the PickerField in markup you need to:

  • If you are developing a NativeScript Core app, you need to register the plugin namespace in the xml:
<Page
   xmlns="http://schemas.nativescript.org/tns.xsd"
   xmlns:picker="nativescript-picker">
   <picker:PickerField hint="Click here" items="{{ pickerItems }}"/>
...
  • If you are developing a NativeScript Angular app, you need to import the plugin module in the module of your component:
import { NativeScriptPickerModule } from "nativescript-picker/angular";
...
@NgModule({
    imports: [
        NativeScriptPickerModule,
        ...
    ],
    ...

Then you will be able to declare the fields in the html of your component:

<PickerField hint="Click here" [items]="pickerItems"></PickerField>
  • If you are developing a NativeScript Vue app, you need to install the plugin in you app.js file:
import Vue from "nativescript-vue";
import { PickerField } from 'nativescript-picker/vue';

Vue.use(PickerField);

Then you will be able to declare the fields in the template of your component:

<PickerField hint="Click here"></PickerField>

Features

PickerField

The PickerField is a NativeScript TextField which means that any functionality the default TextField provides is also available in the PickerField component. The only difference is that by design it is in "read-only" mode, or simply put you cannot change its text by input or select that text. Changing the text of the PickerField is done by its main functionality which is opening a modal popup that shows a list of objects from which you can select one by tapping it.

API

| Property | Description | | --- | --- | | pickerTitle | The title of the modal view. | | items | The source collection used to populate the list of the modal view. | | itemTemplate | Тhe UI template for list view items of the list of the modal view. | | modalAnimated | Optional parameter specifying whether to show the modal view with animation. | | textField | The 'property' of the object from the 'items' collection that will be used by the 'text' property of the PickerField. | | valueField | The 'property' of the object from the 'items' collection that will be used by when setting the 'selectedValue' property of the PickerField. | | selectedValue | The object selected from the list in the modal view. | | selectedIndex | The index of the object from the 'items' collection that has been selected from the list in the modal view. | | iOSCloseButtonPosition | The position of the 'close' button of the ActionBar of the modal view. | | iOSCloseButtonIcon | The icon of the 'close' button of the ActionBar of the modal view. | | androidCloseButtonPosition | The position of the 'close' button of the ActionBar of the modal view. | | androidCloseButtonIcon | The icon of the 'close' button of the ActionBar of the modal view. |

Styling

PickerField

The PickerField can be targeted in CSS through its element selector and additionally by setting a class. The PickerField also opens a modal window containing a Page element that contains an ActionBar and a ListView. This Page element can be targeted with the PickerPage selector and through it style all picker modals with selectors like PickerPage ActionBar and PickerPage ListView. In addition to that, if you set a class on the PickerField, it will be transferred on the PickerPage and with it you can style individual modals.

Contribute

We love PRs! Check out the contributing guidelines. If you want to contribute, but you are not sure where to start - look for issues labeled help wanted.

Get Help

Please, use github issues strictly for reporting bugs or requesting features. For general questions and support, check out Stack Overflow or ask our experts in NativeScript community Slack channel.