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

@tdduydev/react-native-unsigned-input

v0.1.3

Published

Preventing Vietnamese accented characters from being inputted.

Downloads

66

Readme

NPM Known Vulnerabilities

react-native-unsigned-input

  1. Normalizing the input string by removing Vietnamese diacritics and whitespaces:
  • This algorithm takes an input string and performs the following steps:

    a. Decomposes the string into its canonical form using decomposedStringWithCanonicalMapping. This breaks the string into its base characters and their combining marks (diacritics).

    b. Folds the diacritic marks using stringByFoldingWithOptions:NSDiacriticInsensitiveSearch. This step replaces characters with diacritics with their base forms, effectively removing the diacritic marks.

    c. Trims the whitespaces at the beginning and the end of the string using stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]. The result of this algorithm is a normalized string without diacritics and extra whitespaces.

  1. Replacing the input string in the text field with the normalized string:
  • This algorithm updates the text field's content by replacing the characters in a specified range with the normalized string. This is done using the stringByReplacingCharactersInRange:range withString:normalizedString method. As a result, the text field will display the normalized version of the input string, without diacritics and extra whitespaces.

In summary, these two algorithms work together to process a text input by removing Vietnamese diacritics and extra whitespaces, then updating the text field with the normalized string.

Demo

Installation

Make sure to install the @tdduydev/react-native-unsigned-input package and link it with your project.

npm install react-native-unsigned-input --save

Usage

import InputBlurUnsigned from '@tdduydev/react-native-unsigned-input';

// In your JSX
<InputBlurUnsigned
  placeholder="Enter text"
  leftIcon={<YourLeftIcon />}
  rightIcon={<YourRightIcon />}
  onChangeText={(text) => console.log(text)}
/>;

Props

Styling

The component has built-in styling for the TextInput and its container. To customize the styling, use the style, rightIconContainerStyle, and leftIconContainerStyle props as needed.

The backgroundInput prop is used to provide a custom background input for the iOS platform. This prop should be a React Element, and it is optional. If provided, the background input element will be rendered behind the main TextInput component on iOS devices. This can be useful for adding a custom appearance or styling to the input field on iOS.

Methods

focus: This method can be called to focus the TextInput field programmatically. To use it, create a ref for the component and call the focus method on the ref:

const inputRef = useRef();

// Somewhere in your code
inputRef.current.focus();

// In your JSX
<InputBlurUnsigned ref={inputRef} ... />

Supported Languages 🌐

Regenerate response

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Donate

A cup of coffee helps me have more motivation to develop more useful plugins, Thank you

Buy me a coffee

Donate via PayPal