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

tcomb-form-native-builder-components

v0.0.58

Published

Type for `tcomb-form-native` to show static images

Downloads

225

Readme

Build Status Coverage Status

tcomb-form-native-builder-components

Set of extra formats, transformers and types for tcomb-form-native

This module provide some extra components for tcomb-form-native used by tcomb-form-native-builder. Note that they could make use of some customizations and optimizations provided by it, making them incompatible with standard tcomb-form-native.

Factories

Factories are responsible of drawing the UI component and do the data transformations to serialize the info transparent to the user.

All the components can define their style both by definition or runtime options, and they'll be combined. To set a component as centered and shrinked, just set its style to {flexDirection: 'row', justifyContent: 'center'}.

Chips

Allow to get a list of strings as a set of chips buttons.

  • style
    • chipContainer: style of the chip button
    • rootElement: style of the chip buttons wrapper container

Files

Open a platform native file selector to select one or several files, and give an URI to operate with them.

  • style
    • formGroup: style of the wrapper container
    • helpBlock: style of the help info label
    • errorBlock: style of the error info label
  • type: mime type of the files that can be selected. Default: all files

Image

Show a static image, for example a company logo.

  • style
  • uri: location of the image file

Submit

  • contentType: format how the form info will be send to the server. By default, it will be send as multipart/form-data, but you can also set it as application/json.
  • style
    • formGroup: style of the wrapper container
    • helpBlock: style of the help info label
    • errorBlock: style of the error info label
  • uri: address where to POST the form info

Transformers

Objects with methods to do the serialization (format) and deserialization (parse) between the in-wire data format and the one used on the UI components, in case they need to be different for some reason.

arrayStringsFactory(splitter, joiner)

Factory of transformers between a list of strings and a tokenized string. By default, it will split and join using whitespaces.

Types

tcomb types with an associated custom factory to use with tcomb-json-schema. Currently there's one for each one of the factories.

Formats

Functions to validate if strings are of a specific format. Current available ones are date and email.

processSchema(json)

Special function that accept an extended version of the tcomb schema and transform it in a regular one.

select

Extension of select component, allowing to define an uri pointing to a JSON resource with the entries of the select component, and to define the entries as a list of objects.

  • uri: alias of meta.uri option.
  • meta
    • fieldId: if entries are defined as a list of objects, path to the value to be used as id. Default: id.
    • fieldLabel: if entries are defined as a list of objects, path to the value to be used as label. Default: label.
    • placeholders: object mapping the uri placeholders with their actual value to be used.
    • uri: location of the JSON file with the entries of the select. entries can be defined as a list of strings, a mapping object with formatted as value:label, or a list of objects with fields id and value. It can be a templated string and make use of placeholders to be fully generated.